/* CNL Dash — SafePrompt Ops (aligné vitrine) */
@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-v20-latin-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-v20-latin-700.woff2') format('woff2');
}

:root {
  --dash-bg: #0a0a0c;
  --dash-surface: #121216;
  --dash-surface-2: #1a1a20;
  --dash-border: rgba(255, 255, 255, 0.1);
  --dash-lime: #81EF30;
  --dash-lime-dim: rgba(129, 239, 48, 0.15);
  --dash-fg: #f2f2f4;
  --dash-muted: #9a9aa3;
  --dash-danger: #ff5c5c;
  --dash-warn: #ffb020;
  --dash-radius: 8px;
  --dash-font: 'IBM Plex Sans', system-ui, sans-serif;
  --dash-mono: 'IBM Plex Mono', monospace;
}

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

html, body {
  min-height: 100%;
  background: var(--dash-bg);
  color: var(--dash-fg);
  font-family: var(--dash-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--dash-lime); text-decoration: none; }
a:hover { text-decoration: underline; }

.dash-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: var(--dash-surface);
  border-bottom: 1px solid rgba(129, 239, 48, 0.35);
  position: sticky;
  top: 0;
  z-index: 40;
}

.dash-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-brand strong {
  font-family: var(--dash-mono);
  color: var(--dash-lime);
  font-size: 15px;
  letter-spacing: -0.02em;
}

.dash-brand span {
  font-family: var(--dash-mono);
  font-size: 11px;
  color: var(--dash-muted);
}

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

.dash-user {
  font-size: 12px;
  color: var(--dash-muted);
  font-family: var(--dash-mono);
}

.dash-burger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--dash-border);
  background: var(--dash-surface-2);
  border-radius: 6px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.dash-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--dash-lime);
}

.dash-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 20px;
  background: #0d0d10;
  border-bottom: 1px solid var(--dash-border);
}

.dash-nav a {
  font-family: var(--dash-mono);
  font-size: 12px;
  color: var(--dash-muted);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.dash-nav a:hover {
  color: var(--dash-fg);
  background: var(--dash-surface-2);
  text-decoration: none;
}

.dash-nav a.active {
  color: #050505;
  background: var(--dash-lime);
  font-weight: 700;
}

.dash-nav-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.2);
  font-size: 10px;
}

.dash-nav a.active .dash-nav-badge {
  background: rgba(0,0,0,0.18);
}

.dash-main {
  flex: 1;
  padding: 20px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.dash-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--dash-border);
  font-family: var(--dash-mono);
  font-size: 11px;
  color: var(--dash-muted);
  text-align: center;
}

.dash-panel {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  padding: 18px;
  margin-bottom: 16px;
}

.dash-panel h1,
.dash-panel h2,
.dash-title {
  font-family: var(--dash-mono);
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--dash-fg);
}

.dash-title span {
  color: var(--dash-lime);
}

.dash-alert {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 6px;
  border: 1px solid rgba(129, 239, 48, 0.4);
  background: var(--dash-lime-dim);
  font-size: 13px;
}

.dash-alert-error {
  border-color: rgba(255, 92, 92, 0.5);
  background: rgba(255, 92, 92, 0.12);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--dash-surface-2);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-family: var(--dash-mono);
  font-size: 11px;
  color: var(--dash-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-family: var(--dash-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--dash-lime);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--dash-surface-2);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
}

.filter-bar label {
  font-size: 12px;
  color: var(--dash-muted);
  font-family: var(--dash-mono);
}

.filter-bar input[type="date"],
.filter-bar input[type="text"],
.filter-bar input[type="email"],
.filter-bar input[type="password"],
.dash-input,
.dash-textarea {
  background: var(--dash-bg);
  border: 1px solid var(--dash-border);
  color: var(--dash-fg);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--dash-font);
  font-size: 13px;
}

.dash-textarea { width: 100%; min-height: 90px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--dash-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
}

.btn-primary {
  background: var(--dash-lime);
  color: #050505 !important;
}

.btn-primary:hover { filter: brightness(1.05); }

.btn-ghost {
  background: transparent;
  border-color: var(--dash-border);
  color: var(--dash-fg) !important;
}

.btn-ghost:hover {
  border-color: var(--dash-lime);
  color: var(--dash-lime) !important;
}

.btn-danger {
  background: rgba(255, 92, 92, 0.15);
  border-color: var(--dash-danger);
  color: var(--dash-danger) !important;
}

.btn-sm { padding: 4px 8px; font-size: 11px; }

.sec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.chart-box {
  background: var(--dash-surface-2);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  padding: 14px;
  margin-bottom: 16px;
}

.chart-title {
  font-family: var(--dash-mono);
  font-size: 12px;
  color: var(--dash-lime);
  margin-bottom: 12px;
  display: block;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
}

.chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}

.chart-bar {
  width: 100%;
  max-width: 28px;
  background: linear-gradient(180deg, var(--dash-lime), rgba(129, 239, 48, 0.3));
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  position: relative;
}

.chart-bar-value {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: var(--dash-mono);
  color: var(--dash-muted);
}

.chart-bar-label {
  font-size: 9px;
  color: var(--dash-muted);
  font-family: var(--dash-mono);
  text-align: center;
}

.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  font-family: var(--dash-mono);
  font-size: 11px;
  text-align: left;
  color: var(--dash-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--dash-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(129, 239, 48, 0.04);
}

.badge {
  display: inline-block;
  font-family: var(--dash-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.badge-quote { background: rgba(255, 176, 32, 0.15); color: var(--dash-warn); }
.badge-notify { background: rgba(100, 160, 255, 0.15); color: #7eb6ff; }
.badge-access { background: rgba(129, 239, 48, 0.15); color: var(--dash-lime, #81EF30); }
.badge-pending { background: var(--dash-lime-dim); color: var(--dash-lime); }
.badge-done { background: rgba(255,255,255,0.08); color: var(--dash-muted); }
.badge-danger { background: rgba(255, 92, 92, 0.15); color: var(--dash-danger); }

.lead-cards { display: none; }

.lead-card {
  background: var(--dash-surface-2);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  padding: 14px;
  margin-bottom: 10px;
}

.lead-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.muted { color: var(--dash-muted); }
.mono { font-family: var(--dash-mono); }

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-group label {
  font-family: var(--dash-mono);
  font-size: 11px;
  color: var(--dash-muted);
  text-transform: uppercase;
}

.product-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-checklist li {
  padding: 10px 12px;
  background: var(--dash-surface-2);
  border: 1px solid var(--dash-border);
  border-radius: 6px;
  font-size: 13px;
}

.product-checklist li strong {
  color: var(--dash-lime);
  font-family: var(--dash-mono);
}

/* Guest / auth pages */
.dash-guest {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at top, rgba(129, 239, 48, 0.08), transparent 50%),
    var(--dash-bg);
}

.dash-guest-card {
  width: 100%;
  max-width: 420px;
  background: var(--dash-surface);
  border: 1px solid rgba(129, 239, 48, 0.3);
  border-radius: 10px;
  padding: 28px 24px;
}

.dash-guest-card h1 {
  font-family: var(--dash-mono);
  font-size: 1.25rem;
  color: var(--dash-lime);
  margin-bottom: 8px;
}

.dash-guest-card .sub {
  color: var(--dash-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

.dash-nav-overlay {
  display: none;
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .sec-grid, .split-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .dash-burger { display: flex; }
  .dash-user { display: none; }

  .dash-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0,0,0,0.92);
    flex-direction: column;
    padding: 72px 20px 24px;
    gap: 8px;
  }

  .dash-nav.open { display: flex; }

  .dash-nav a {
    font-size: 15px;
    padding: 14px 16px;
    border: 1px solid var(--dash-border);
  }

  .dash-nav-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--dash-border);
    background: var(--dash-surface);
    color: var(--dash-lime);
    border-radius: 6px;
    font-size: 22px;
    cursor: pointer;
  }

  .table-desktop { display: none; }
  .lead-cards { display: block; }

  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .btn { width: 100%; }

  .dash-main { padding: 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 1.25rem; }
}

/* Rebuild v2 utilities */
.dash-inline-form { display: inline; }
.dash-notes-form { display: flex; gap: 6px; align-items: center; }
.dash-notes-form .dash-input { min-width: 120px; }
.dash-panel-nested { margin: 0; }
.dash-panel-spaced { margin-top: 16px; }
.stats-grid-spaced { margin-top: 12px; }
.stat-value-sm { font-size: 1.3rem; }
.section-lead { margin-bottom: 14px; }
.section-actions { margin-bottom: 14px; }
.filter-bar-label { margin-left: auto; }
.text-right { text-align: right; }
.empty-cell { text-align: center; padding: 24px; }
.lead-email { margin-bottom: 6px; }
.lead-meta { font-size: 12px; margin-bottom: 8px; }
.dash-input-full { width: 100%; margin-bottom: 8px; }
.btn-block { width: 100%; }
.nowrap { white-space: nowrap; }
.log-msg { font-size: 12px; }
.status-line { margin-bottom: 12px; }
.logs-actions { margin-top: 16px; }
.stack-form { margin-bottom: 10px; }
.pagination-bar { margin-top: 12px; }
.chart-title-spaced { margin-top: 20px; }
.ban-reason { margin: 6px 0; }
.journey-path { font-size: 12px; }
.mfa-box { text-align: center; margin-bottom: 16px; }
.mfa-qr { border-radius: 6px; background: #fff; padding: 6px; }
.mfa-secret { margin-top: 8px; font-size: 12px; word-break: break-all; }
.mfa-uri { display: inline-block; margin-top: 8px; font-size: 11px; word-break: break-all; }
.product-cta-row { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }

/* Health + focus */
.dash-health {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--dash-border);
  border-radius: 6px;
  background: var(--dash-surface-2);
}
.dash-health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dash-muted);
}
.dash-health-dot.ok { background: var(--dash-lime); }
.dash-health-dot.warn { background: var(--dash-warn); }
.dash-health-dot.down { background: var(--dash-danger); }
.dash-health-label { font-size: 10px; color: var(--dash-muted); }
.dash-focus-switch { display: flex; gap: 4px; }
.dash-focus-switch .btn.active {
  border-color: var(--dash-lime);
  color: var(--dash-lime);
}
body.dash-focus-ops .nav-growth { display: none; }
body.dash-focus-growth .nav-ops { display: none; }

/* Leads inbox */
.data-table-dense td, .data-table-dense th { padding: 8px 10px; }
.row-overdue { background: rgba(255, 92, 92, 0.08); }
.lead-card-overdue { border-color: var(--dash-danger); }
.stat-danger { color: var(--dash-danger) !important; }
.dash-nav-badge-warn {
  background: rgba(255, 92, 92, 0.2);
  color: var(--dash-danger);
}

/* Funnel */
.funnel-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.funnel-row { display: grid; grid-template-columns: 120px 1fr 56px; gap: 10px; align-items: center; }
.funnel-label { font-size: 12px; color: var(--dash-muted); }
.funnel-bar-track {
  height: 10px;
  background: var(--dash-surface-2);
  border-radius: 4px;
  overflow: hidden;
}
.funnel-bar {
  height: 100%;
  background: var(--dash-lime);
  min-width: 2px;
}
.funnel-val { text-align: right; font-size: 12px; }
.consent-line { margin-top: 12px; font-size: 12px; }

/* Newsletter preview */
.newsletter-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.newsletter-preview {
  background: #0e0e12;
  border: 1px solid var(--dash-border);
  border-radius: 8px;
  padding: 14px;
  min-height: 220px;
}
.newsletter-preview-subject {
  color: var(--dash-lime);
  margin-bottom: 10px;
  font-size: 13px;
}
.newsletter-preview-body {
  color: var(--dash-fg);
  font-size: 13px;
  line-height: 1.55;
  white-space: normal;
}

@media (max-width: 900px) {
  .dash-health-label { display: none; }
  .dash-focus-switch { display: none; }
  .funnel-row { grid-template-columns: 1fr; gap: 4px; }
}


