/* =========================================================
   GROUND OS – UI FOUNDATION v1 (STABLE)
   Visual: Claro, Clean, Premium
   Primary: #0e0e25
   ========================================================= */

/* =========================
   0. TOKENS (Single Source)
   ========================= */

:root{
  --gh-bg: #f8fafc;
  --gh-text: #1f2937;
  --gh-muted: #6b7280;

  --gh-card-bg: #ffffff;
  --gh-border: #eef2f7;
  --gh-border-soft: #f1f5f9;

  --gh-primary: #2929bf;
  --gh-primary-hover: #0e0e25;
  --theme-deafult: #2929bf;

  --gh-light: #f3f4f6;
  --gh-light-hover: #e5e7eb;

  --gh-danger: #ef4444;
  --gh-danger-hover: #dc2626;

  --gh-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);

  --gh-radius: 12px;
  --gh-radius-sm: 8px;
}

/* =========================
   1. BASE & BACKGROUND
   ========================= */

body{
  background-color: var(--gh-bg);
  color: var(--gh-text);
  font-weight: 400;
}

.page-wrapper{
  background-color: var(--gh-bg);
}

.page-wrapper.compact-wrapper .page-body-wrapper .page-body {
  padding-top: 24px;
}

.card-header-tabs {
  margin-bottom: 0 !important;
}

/* =========================
   2. CARDS (Premium Clean)
   ========================= */

.card{
  background-color: var(--gh-card-bg);
  border-radius: var(--gh-radius);
  border: 1px solid var(--gh-border-soft);
  box-shadow: none;
}

.card-header{
  background-color: var(--gh-card-bg);
  border-bottom: 1px solid var(--gh-border-soft);
  padding: 20px 24px;
  font-weight: 600;
  font-size: 15px;
}

.card-body{
  padding: 24px;
}

/* =========================
   3. FORMS
   ========================= */

.theme-form .form-control{
  height: 42px;
  border-radius: var(--gh-radius-sm);
  border: 1px solid #e5e7eb;
  box-shadow: none;
}

.theme-form .form-control:focus{
  border-color: var(--gh-primary);
  box-shadow: 0 0 0 2px rgba(14, 14, 37, 0.10);
}

.theme-form .col-form-label{
  font-weight: 500;
  color: #374151;
}

.input-group-text{
  background-color: var(--gh-light);
  border: 1px solid #e5e7eb;
  border-radius: 0 var(--gh-radius-sm) var(--gh-radius-sm) 0;
}

/* =========================
   4. BUTTONS (OS Standard)
   ========================= */

.btn{
  border-radius: var(--gh-radius-sm);
  font-weight: 500;
  padding: 8px 18px;
  transition: all 0.2s ease;
}

/* Primary (GLOBAL) */
.btn-primary{
  background-color: var(--gh-primary)!important;
  border-color: var(--gh-primary)!important;
  color: #fff;
}

.btn-primary:hover{
  background-color: var(--gh-primary-hover)!important;
  border-color: var(--gh-primary-hover)!important;
  color: #fff;
}

/* Light */
.btn-light{
  background-color: var(--gh-light);
  border-color: #e5e7eb;
  color: #374151;
}

.btn-light:hover{
  background-color: var(--gh-light-hover);
}

/* Danger */
.btn-danger{
  background-color: var(--gh-danger);
  border-color: var(--gh-danger);
  color: #fff;
}

.btn-danger:hover{
  background-color: var(--gh-danger-hover);
  border-color: var(--gh-danger-hover);
}

/* Small */
.btn-sm{
  padding: 6px 12px;
  font-size: 13px;
}

.btn-xs{
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.5;
  border-radius: 6px;
}

/* =========================
   5. TABLES (OS Standard)
   ========================= */

.table{
  margin-bottom: 0;
  font-size: 14px;
}

.table thead th{
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #2929bf;
}

.table tbody tr{
  border-bottom: 1px solid var(--gh-border-soft);
}

.table tbody tr:hover{
  background-color: #f3f4f6;
}

.table td{
  vertical-align: middle;
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 13px;
  color: #000;
}

/* =========================
   6. BADGES
   ========================= */

.badge{
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 500;
}

.badge-primary{
  background-color: var(--gh-primary);
  color: #fff;
}

.badge-light{
  background-color: #373333;
  color: #fff;
}

.bg-primary{
  background-color: #2929bf !important;
}

.badge-danger{
  background-color: var(--gh-danger);
  color: #fff;
}

/* Badge Categoria - Premium Dark */
.badge-category{
  background-color: #111827;
  color: #ffffff;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  letter-spacing: 0.3px;
}

/* =========================
   7. SWITCH (Official)
   ========================= */

.switch{
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input{
  display: none;
}

.switch-state{
  position: absolute;
  cursor: pointer;
  background-color: #e5e7eb;
  border-radius: 24px;
  transition: 0.3s;
  width: 100%;
  height: 100%;
}

.switch-state:before{
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .switch-state{
  background-color: var(--gh-primary);
}

.switch input:checked + .switch-state:before{
  transform: translateX(22px);
}

/* =========================
   8. PAGE HEADERS
   ========================= */

.page-header{
  margin-bottom: 24px;
}

.page-header h3{
  font-weight: 600;
  font-size: 20px;
  color: #111827;
}

/* ================================
   FILTER PANEL - Ground OS
================================ */

.ground-filter-panel{
  background: var(--gh-card-bg);
  border: 1px solid var(--gh-border-soft);
  border-radius: 14px;
  padding: 20px;
}

.filter-label{
  font-size: 12px;
  font-weight: 600;
  color: var(--gh-muted);
  margin-bottom: 6px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ================================
   MODAL - Ground OS Premium
================================ */

.ground-modal .modal-content{
  border-radius: 16px;
  border: none;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.ground-modal-header{
  border-bottom: 1px solid var(--gh-border-soft);
  padding: 20px 24px;
}

.ground-modal-body{
  padding: 28px 24px;
}

.ground-modal-footer{
  border-top: 1px solid var(--gh-border-soft);
  padding: 18px 24px;
}

.modal-label{
  font-size: 12px;
  font-weight: 600;
  color: var(--gh-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.modal-title{
  font-weight: 600;
}

/* ================================
   SIDE PANEL - Ground OS
================================ */

/* =========================
   KPI Waste Card
   ========================= */

.kpi-waste-card{
  border-radius: 16px;
  background: var(--gh-card-bg);
  padding: 16px;
  margin-top: 10px;
}

.kpi-label{
  font-size: 0.9rem;
  color: #6c757d;
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
}

.kpi-value{
  font-size: 2.8rem;
  font-weight: 700;
  color: #212529;
  margin: 0;
  line-height: 1;
}

.kpi-sub{
  font-size: 0.9rem;
  color: #6c757d;
  margin-top: 4px;
  display: block;
}

.kpi-icon{
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.kpi-icon svg{
  width: 60px;
  height: 60px;
  color: #2929bf;
}

/* Espaçamento específico para header do fecho Bora */
.gh-fecho-header{
  margin-top: 24px;
}

/* =========================
   FORM ACTIONS (ALWAYS THIS)
   ========================= */

.gh-form-actions .btn{
  border-radius: 10px;
  font-weight: 500;
  padding: 10px 18px;
  line-height: 1.1;
}

/* Botão secundário */
.gh-form-actions .btn.btn-light{
  background: var(--gh-light);
  border: 1px solid #e5e7eb;
  color: #111827;
}

.gh-form-actions .btn.btn-light:hover{
  background: var(--gh-light-hover);
}

/* Botão primário (FIXO) */
.gh-form-actions .btn.btn-primary{
  background: var(--gh-primary);
  border: 1px solid var(--gh-primary);
  color: #fff;
}

.gh-form-actions .btn.btn-primary:hover{
  background: var(--gh-primary-hover);
  border-color: var(--gh-primary-hover);
  color: #fff;
}
.card.p-3 {
  border: 1px solid #f1f5f9;
  border-radius: 14px;
  transition: 0.2s ease;
}

.card.p-3:hover {
  border-color: #e5e7eb;
  background: #fafafa;
}
/* CONTAINER */
.ground-sidepanel {
  position: fixed;
  inset: 0;
  z-index: 1055;
  pointer-events: none;
}

/* OVERLAY */
.ground-sidepanel-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity .25s ease;
}

/* CONTENT */
.ground-sidepanel-content {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 480px;
  max-width: 100%;
  background: var(--gh-card-bg, #fff);
  box-shadow: -8px 0 30px rgba(0,0,0,.1);
  transform: translateX(100%);
  transition: transform .3s ease;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.ground-sidepanel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gh-border-soft, #f1f5f9);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.ground-sidepanel-header h5 {
  margin: 0;
  font-weight: 600;
}

.sidepanel-subtitle {
  font-size: 13px;
  color: var(--gh-muted, #6b7280);
}

/* BODY */
.ground-sidepanel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* FOOTER */
.ground-sidepanel-footer {
  border-top: 1px solid var(--gh-border-soft, #f1f5f9);
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ACTIVE STATE */
.ground-sidepanel.active {
  pointer-events: auto;
}

.ground-sidepanel.active .ground-sidepanel-overlay {
  opacity: 1;
}

.ground-sidepanel.active .ground-sidepanel-content {
  transform: translateX(0);
}

/* ── gh-financial: Enterprise Finance Summary ─────────────────────────── */
.gh-financial-finance { padding: 24px; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #334155; }

.gh-financial-finance .fs-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.gh-financial-finance .fs-grid-6 { grid-template-columns: repeat(6, 1fr); }
.gh-financial-finance .fs-grid-2 { grid-template-columns: repeat(2, 1fr); }
.gh-financial-finance .fs-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1200px) { .gh-financial-finance .fs-grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .gh-financial-finance .fs-grid-6, .gh-financial-finance .fs-grid-2, .gh-financial-finance .fs-grid-3 { grid-template-columns: 1fr; } }

.gh-financial-finance .f-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.03); margin-bottom: 16px; }
.gh-financial-finance .f-card-header { padding: 16px 20px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.gh-financial-finance .f-card-header h3 { margin: 0; font-size: 14px; font-weight: 700; color: #0f172a; }
.gh-financial-finance .f-card-body { padding: 20px; }

.gh-financial-finance .gh-title { font-size: 22px; font-weight: 900; margin: 0; color: #0f172a; line-height: 1.2; }
.gh-financial-finance .gh-subtitle { font-size: 12px; margin-top: 6px; color: #94a3b8; }

.gh-financial-finance .kpi-box { padding: 18px 20px; transition: transform .15s; }
.gh-financial-finance .kpi-box:hover { transform: translateY(-2px); }
.gh-financial-finance .kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; font-weight: 700; }
.gh-financial-finance .kpi-value { font-size: 20px; font-weight: 900; color: #0f172a; margin-top: 5px; font-variant-numeric: tabular-nums; }
.gh-financial-finance .kpi-sub { font-size: 11px; color: #94a3b8; margin-top: 5px; }

.gh-financial-finance .f-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gh-financial-finance .f-table th { padding: 10px 14px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; border-bottom: 2px solid #f1f5f9; background: #fcfcfd; font-weight: 700; white-space: nowrap; }
.gh-financial-finance .f-table td { padding: 10px 14px; border-bottom: 1px solid #f8fafc; }
.gh-financial-finance .f-table tbody tr:last-child td { border-bottom: none; }
.gh-financial-finance .f-table tbody tr:hover td { background: #fafafa; }

.gh-financial-finance .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-family: 'Courier New', monospace; font-size: 12.5px; }

.gh-financial-finance .row-parent td { font-weight: 700; color: #0f172a; background-color: #f8fafc; }
.gh-financial-finance .row-child td { padding-left: 32px !important; color: #64748b; font-weight: 400; }
.gh-financial-finance .row-total-final td { font-weight: 900; background: #f1f5f9; color: #0f172a; border-top: 2px solid #cbd5e1 !important; }

.gh-financial-finance .f-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; background: #f1f5f9; color: #475569; white-space: nowrap; display: inline-block; }

.gh-financial-finance .text-pos  { color: #10b981 !important; }
.gh-financial-finance .text-neg  { color: #ef4444 !important; }
.gh-financial-finance .text-warn { color: #f59e0b !important; }
.gh-financial-finance .text-muted { color: #94a3b8 !important; }

/* ── Demonstração de Resultados (finance/summary.php) ─────────────────── */
.dr-container { font-size: 13px; color: var(--gh-text); }

.dr-header {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gh-muted);
  padding: 6px 0 12px;
  border-bottom: 2px solid var(--gh-border);
  margin-bottom: 20px;
}

.dr-section { margin-bottom: 20px; }

.dr-section-title {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gh-primary);
  padding: 4px 0;
  border-bottom: 1px solid var(--gh-border-soft);
  margin-bottom: 4px;
}

.dr-row {
  display: flex;
  align-items: flex-end;
  padding: 2px 0;
  gap: 4px;
}

.dr-label {
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.7;
  padding-right: 2px;
}
.dr-label.indent  { padding-left: 18px; }
.dr-label.indent2 { padding-left: 34px; }

.dr-dots {
  flex: 1;
  border-bottom: 1px dotted #d1d5db;
  margin-bottom: 5px;
  min-width: 16px;
}

.dr-value {
  white-space: nowrap;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  text-align: right;
  min-width: 120px;
  line-height: 1.7;
  padding-left: 2px;
}

.dr-row.subtotal {
  padding-top: 4px;
  border-top: 1px solid #e5e7eb;
  margin-top: 2px;
}
.dr-row.subtotal .dr-label,
.dr-row.subtotal .dr-value { font-weight: 700; }
.dr-row.subtotal .dr-dots  { border-bottom: none; }

.dr-row.dr-total {
  padding: 5px 0;
  border-top: 2px solid #374151;
  border-bottom: 2px solid #374151;
  margin-top: 4px;
}
.dr-row.dr-total .dr-label,
.dr-row.dr-total .dr-value { font-weight: 700; font-size: 15px; }
.dr-row.dr-total .dr-dots  { border-bottom: none; }

.dr-row.placeholder .dr-label,
.dr-row.placeholder .dr-value { color: var(--gh-muted); font-style: italic; }

.dr-sub-header .dr-label { font-weight: 600; font-size: 12px; padding-top: 6px; }
.dr-sub-header .dr-dots  { border-bottom: none; }

.dr-col-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: start;
}
@media (max-width: 900px) { .dr-col-2 { grid-template-columns: 1fr; } }

.dr-alert-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 12.5px;
  line-height: 1.4;
}
.dr-alert-danger  { background: #fef2f2; border-left: 3px solid var(--gh-danger); color: #991b1b; }
.dr-alert-warning { background: #fffbeb; border-left: 3px solid #f59e0b;          color: #92400e; }
.dr-alert-info    { background: #eff6ff; border-left: 3px solid var(--gh-primary); color: #1e40af; }
.dr-alert-success { background: #f0fdf4; border-left: 3px solid #16a34a;           color: #14532d; }

/* =========================
   SALES COMPONENTS
   ========================= */

/* Score bar mini — track + fill (width e background-color dinâmicos via inline PHP) */
.score-bar-track {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.score-bar-fill {
  height: 6px;
  border-radius: 3px;
  transition: width .3s, background-color .3s;
}

/* Score bar preview (visit-new.php — maior) */
.score-bar-preview-track {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
.score-bar-preview-fill {
  height: 8px;
  border-radius: 4px;
  transition: width .4s, background-color .3s;
}

/* Note popover tooltip */
.note-popover-tooltip {
  display: none;
  position: fixed;
  z-index: 9999;
  background: #1f2937;
  color: #fff;
  padding: .5rem .75rem;
  border-radius: 8px;
  font-size: .78rem;
  max-width: 280px;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* Status badges para waitlist */
.status-badge-waiting   { background: #fef3c7; color: #92400e; padding: .2rem .5rem; border-radius: 4px; font-size: .72rem; font-weight: 600; }
.status-badge-notified  { background: #dbeafe; color: #1e40af; padding: .2rem .5rem; border-radius: 4px; font-size: .72rem; font-weight: 600; }
.status-badge-converted { background: #dcfce7; color: #166534; padding: .2rem .5rem; border-radius: 4px; font-size: .72rem; font-weight: 600; }
.status-badge-cancelled { background: #fee2e2; color: #991b1b; padding: .2rem .5rem; border-radius: 4px; font-size: .72rem; font-weight: 600; }

/* Score inline value display */
.score-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.score-inline .score-track { width: 40px; }
.score-inline .score-value { font-size: .8rem; font-weight: 700; }

/* Star rating buttons */
.star-btn {
  background: none;
  border: none;
  padding: 2px;
  font-size: 1.5rem;
  color: #d1d5db;
  cursor: pointer;
  line-height: 1;
  transition: color .15s;
}
.star-btn.active,
.star-btn:hover { color: #f59e0b; }

/* Card de confirmação com borda de sucesso */
.card-success-border { border-left: 4px solid #16a34a; }
.card-warning-border { border-left: 4px solid #f59e0b; }
.card-danger-border  { border-left: 4px solid #ef4444; }

/* Icon circle (success/warning/danger) */
.icon-circle {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon-circle-success { background: #dcfce7; }
.icon-circle-warning { background: #fef3c7; }
.icon-circle-danger  { background: #fee2e2; }
.icon-circle-primary { background: #e0e7ff; }

/* Score preview box (visit-new.php) */
.score-preview-box {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 1rem;
}

/* Filter section label (waitlist filtros) */
.filter-section-label {
  font-size: .78rem;
  color: var(--gh-muted);
  font-weight: 500;
}

/* Form label utilities */
.form-label-sm  { font-size: .82rem; }
.form-label-xs  { font-size: .78rem; }

/* Card section title (h6 em card-header) */
.card-section-title {
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════
   CUSTOMER JOURNEY
   ═══════════════════════════════════════════════════════════════ */

/* Timeline container */
.journey-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Separador de data */
.journey-date-divider {
  font-size: .72rem;
  font-weight: 600;
  color: var(--gh-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .5rem 0 .5rem 44px;
  border-bottom: 1px solid var(--gh-border-soft);
  margin-bottom: .25rem;
}

/* Evento */
.journey-event {
  display: flex;
  gap: 0;
  padding: .5rem 0;
  position: relative;
}

/* Coluna do ícone */
.journey-event-icon-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 36px;
  flex-shrink: 0;
  padding-top: 2px;
}

.journey-event-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}

.journey-event-line {
  width: 2px;
  flex-grow: 1;
  background: var(--gh-border-soft);
  margin-top: 4px;
  min-height: 16px;
}

.journey-event:last-child .journey-event-line { display: none; }

/* Corpo do evento */
.journey-event-body {
  flex-grow: 1;
  padding: .25rem .5rem .75rem .75rem;
}

.journey-event-headline {
  font-size: .85rem;
  font-weight: 600;
  color: var(--gh-text);
  line-height: 1.3;
}

/* Mini badges de categoria/source */
.journey-badge {
  display: inline-flex;
  align-items: center;
  font-size: .68rem;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--gh-light);
  color: var(--gh-muted);
  font-weight: 500;
  line-height: 1.4;
}

/* Detalhe expansível */
.journey-event-detail {
  margin-top: .5rem;
  padding: .75rem;
  background: var(--gh-bg);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-sm);
  font-size: .8rem;
}

.journey-detail-key {
  display: inline-block;
  color: var(--gh-muted);
  font-size: .72rem;
  min-width: 90px;
  text-transform: lowercase;
}

.journey-detail-val {
  font-size: .8rem;
  color: var(--gh-text);
  font-weight: 500;
}

.journey-payload-json {
  font-size: .72rem;
  background: #1e293b;
  color: #94a3b8;
  border-radius: var(--gh-radius-sm);
  padding: .75rem;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* Identidades (painel direito) */
.journey-identity-group {
  border-bottom: 1px solid var(--gh-border-soft);
}
.journey-identity-group:last-child { border-bottom: none; }

.journey-identity-source {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gh-muted);
  padding: .5rem .75rem .25rem;
  background: var(--gh-bg);
}

.journey-identity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .35rem .75rem;
  font-size: .8rem;
  border-top: 1px solid var(--gh-border-soft);
}

/* Signals (quick stats) */
.journey-signal-card {
  background: var(--gh-bg);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-sm);
  padding: .6rem .75rem;
  text-align: center;
}

.journey-signal-card--warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.journey-signal-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gh-text);
  line-height: 1;
}

.journey-signal-lbl {
  font-size: .68rem;
  color: var(--gh-muted);
  margin-top: 3px;
}

/* ═══════════════════════════════════════════════════════════════
   CUSTOMER JOURNEY v2 — Rail Timeline (.jny-*)
   ═══════════════════════════════════════════════════════════════ */

/* Rail container */
.jny-rail {
  display: flex;
  flex-direction: column;
}

/* Date separator */
.jny-date-sep {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gh-muted);
  padding: .6rem 0 .3rem 42px;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.jny-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gh-border-soft);
}

/* Item row */
.jny-item {
  display: flex;
  gap: 0;
  position: relative;
  padding: 2px 0;
}

/* Dot column */
.jny-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 34px;
  flex-shrink: 0;
  padding-top: 5px;
}

.jny-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid;
  background: #fff;
  flex-shrink: 0;
  z-index: 1;
}

.jny-dot--filled {
  /* background e border-color definidos inline */
}

.jny-line {
  width: 2px;
  flex-grow: 1;
  background: var(--gh-border-soft);
  margin-top: 3px;
  min-height: 14px;
}

.jny-item:last-child .jny-line { display: none; }

/* Item body */
.jny-body {
  flex-grow: 1;
  padding: 3px 8px 10px 6px;
  border-left: 2px solid transparent;
  margin-left: 2px;
}

/* Highlight items: fundo tênue + borda colorida */
.jny-item--highlight .jny-body {
  background: var(--gh-bg);
  border-radius: 0 var(--gh-radius-sm) var(--gh-radius-sm) 0;
  padding: 6px 10px 10px 10px;
  border-left-width: 3px;
  margin-left: 0;
}

/* Headline */
.jny-headline {
  font-size: .84rem;
  font-weight: 600;
  color: var(--gh-text);
  line-height: 1.3;
  margin-bottom: 3px;
}

/* Time stamp */
.jny-time {
  font-size: .67rem;
  color: var(--gh-muted);
  white-space: nowrap;
}

/* Expand button */
.jny-expand-btn {
  background: none;
  border: 1px solid var(--gh-border);
  border-radius: 4px;
  padding: 1px 4px;
  cursor: pointer;
  color: var(--gh-muted);
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.jny-expand-btn:hover { background: var(--gh-light); }

/* Chips row */
.jny-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

.jny-chip {
  font-size: .64rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 500;
  line-height: 1.6;
}

.jny-chip--cat {
  /* background e color definidos inline via style */
}

.jny-chip--src {
  background: var(--gh-light);
  color: var(--gh-muted);
}

.jny-chip--meta {
  background: transparent;
  color: #9ca3af;
  padding: 1px 3px;
}

/* Detail panel (expandível) */
.jny-detail {
  margin-top: .4rem;
  padding: .6rem .75rem;
  background: var(--gh-bg);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-sm);
  font-size: .78rem;
}

/* Cluster card */
.jny-cluster {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--gh-bg);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-sm);
  padding: 4px 10px 4px 8px;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s;
  width: 100%;
  text-align: left;
}

.jny-cluster:hover {
  border-color: #d1d5db;
  background: var(--gh-light);
}

.jny-cluster.is-open {
  border-color: var(--gh-primary);
  background: #eff6ff;
}

.jny-cluster-count {
  font-size: .7rem;
  font-weight: 700;
  color: var(--gh-muted);
  background: var(--gh-light);
  border-radius: 10px;
  padding: 1px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.jny-cluster.is-open .jny-cluster-count {
  background: var(--gh-primary);
  color: #fff;
}

.jny-cluster-label {
  font-size: .78rem;
  color: var(--gh-text);
  flex-grow: 1;
}

.jny-cluster-expand-icon {
  flex-shrink: 0;
  color: var(--gh-muted);
  transition: transform .2s;
  display: inline-flex;
}

.jny-cluster.is-open .jny-cluster-expand-icon {
  transform: rotate(180deg);
}

/* Cluster inner items */
.jny-cluster-items {
  display: none;
  flex-direction: column;
  margin-top: 4px;
  padding: 4px 0 2px 10px;
  border-left: 2px solid var(--gh-border-soft);
  gap: 1px;
}

.jny-cluster-items.is-open { display: flex; }

.jny-cluster-item {
  font-size: .74rem;
  color: var(--gh-muted);
  padding: 2px 0;
  display: flex;
  gap: 6px;
  align-items: baseline;
}

/* Preset bar */
.jny-preset-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.jny-preset-btn {
  font-size: .72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--gh-border);
  background: var(--gh-card-bg);
  color: var(--gh-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  line-height: 1.5;
}

.jny-preset-btn:hover,
.jny-preset-btn.active {
  background: var(--gh-primary);
  border-color: var(--gh-primary);
  color: #fff;
  text-decoration: none;
}

/* Highlights toggle */
.jny-hl-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--gh-muted);
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--gh-border);
  background: var(--gh-card-bg);
  text-decoration: none;
  transition: all .15s;
  line-height: 1.5;
}

.jny-hl-toggle:hover { text-decoration: none; }

.jny-hl-toggle.is-on {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

/* Load more */
.jny-load-more {
  display: flex;
  justify-content: center;
  padding: 1rem 0 .75rem;
}

/* Identidades flat */
.jny-id-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: .3rem .75rem;
  border-bottom: 1px solid var(--gh-border-soft);
  font-size: .77rem;
}

.jny-id-row:last-child { border-bottom: none; }

.jny-id-src {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #fff;
  background: var(--gh-muted);
  padding: 1px 5px;
  border-radius: 7px;
  flex-shrink: 0;
  white-space: nowrap;
}

.jny-id-type {
  font-size: .67rem;
  color: var(--gh-muted);
  min-width: 44px;
  flex-shrink: 0;
}

.jny-id-val {
  flex-grow: 1;
  color: var(--gh-text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jny-id-conf {
  font-size: .62rem;
  color: var(--gh-muted);
  flex-shrink: 0;
}

/* ── Finance cluster variant ──────────────────────────────────────────────────── */
.jny-cluster--finance {
  background: #fffbeb;
  border-color: #f59e0b44;
}

.jny-cluster--finance:hover {
  background: #fef3c7;
  border-color: #f59e0b;
}

.jny-cluster--finance.is-open {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}

.jny-cluster-amt {
  font-size: .72rem;
  font-weight: 700;
  color: #92400e;
  background: #fde68a;
  border-radius: 10px;
  padding: 1px 8px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Toggle buttons (excl_vol, group_recurrent) ───────────────────────────────── */
.jny-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 600;
  color: var(--gh-muted);
  cursor: pointer;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--gh-border);
  background: var(--gh-card-bg);
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1.5;
}

.jny-toggle-btn:hover {
  text-decoration: none;
  color: var(--gh-text);
  border-color: #d1d5db;
}

.jny-toggle-btn.is-on {
  background: #eff6ff;
  border-color: var(--gh-primary);
  color: var(--gh-primary);
}

/* ── Selected item ────────────────────────────────────────────────────────────── */
.jny-item.is-selected .jny-body {
  background: #eff6ff;
  border-radius: 0 var(--gh-radius-sm) var(--gh-radius-sm) 0;
}

.jny-item.is-selected.jny-item--highlight .jny-body {
  background: #dbeafe;
}

/* ── Split View — Detail Panel ────────────────────────────────────────────────── */
.jny-dp-headline {
  font-size: .88rem;
  font-weight: 700;
  color: var(--gh-text);
  line-height: 1.35;
  padding: .35rem .55rem;
  margin-bottom: .6rem;
  border-radius: 0 var(--gh-radius-sm) var(--gh-radius-sm) 0;
  background: var(--gh-bg);
}

.jny-dp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-bottom: .7rem;
}

.jny-dp-time {
  font-size: .68rem;
  color: var(--gh-muted);
  margin-left: auto;
  white-space: nowrap;
}

.jny-dp-fields {
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-sm);
  overflow: hidden;
}

.jny-dp-field {
  display: flex;
  gap: 8px;
  padding: .35rem .6rem;
  border-bottom: 1px solid var(--gh-border-soft);
  font-size: .77rem;
}

.jny-dp-field:last-child { border-bottom: none; }

.jny-dp-key {
  color: var(--gh-muted);
  flex-shrink: 0;
  min-width: 75px;
  font-size: .7rem;
}

.jny-dp-val {
  color: var(--gh-text);
  font-weight: 500;
  word-break: break-all;
}

.jny-dp-ref {
  font-size: .65rem;
  color: var(--gh-muted);
  margin-top: .5rem;
}

/* ── Detail key/val (cluster expand items) ─────────────────────────────────────── */
.jny-detail-key {
  font-size: .7rem;
  color: var(--gh-muted);
  min-width: 75px;
  flex-shrink: 0;
}

.jny-detail-val {
  font-size: .74rem;
  color: var(--gh-text);
  font-weight: 500;
  word-break: break-all;
}