/* ===== Componentes universais dos painéis (callbox, classificação, marketing) ===== */

.badge-status {
      font-size: 11px;
      font-weight: 700;
      padding: 4px 10px;
      border-radius: 999px;
      white-space: nowrap;
    }

.bs-err {
      background: var(--error-soft);
      color: var(--error);
    }

.bs-idle {
      background: rgba(111, 108, 101, .1);
      color: var(--muted);
    }

.bs-ok {
      background: var(--success-soft);
      color: var(--success);
    }

.btn-refresh {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 18px;
      border-radius: 10px;
      background: var(--primary);
      color: #fff;
      font-family: 'DM Sans', sans-serif;
      font-size: 14px;
      font-weight: 700;
      border: none;
      cursor: pointer;
      transition: opacity .15s, transform .1s;
    }

.btn-refresh svg {
      width: 15px;
      height: 15px;
      transition: transform .6s ease;
    }

.btn-refresh.loading svg {
      animation: spin .7s linear infinite;
    }

.btn-refresh:active {
      transform: scale(.97);
    }

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

.btn-refresh:hover {
      opacity: .88;
    }

.card {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
    }

.date-input {
      padding: 6px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg);
      font-family: 'DM Sans', sans-serif;
      font-size: 13px;
      color: var(--text);
      outline: none;
      transition: border-color .15s;
      cursor: pointer;
    }

.date-input:focus {
      border-color: var(--primary);
    }

.date-inputs {
      display: flex;
      align-items: center;
      gap: 8px;
    }

.date-inputs span {
      font-size: 12px;
      color: var(--muted);
    }

.date-presets {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

.date-range-label {
      font-size: 12px;
      color: var(--muted);
      white-space: nowrap;
      margin-left: auto;
    }

.date-range-label strong {
      color: var(--primary);
      font-weight: 700;
    }

/* ── KPIs: evita overflow em telas estreitas, encolhendo a fonte pelo
   tamanho real do bloco (container query) em vez de um breakpoint fixo. ── */
.kpi {
      padding: 20px;
      container-type: inline-size;
      min-width: 0;
      overflow: hidden;
    }

.kpi .l {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: .09em;
      color: #9a9891;
      font-weight: 700;
    }

.kpi .m {
      font-size: 13px;
      color: var(--muted);
      margin-top: 6px;
    }

.kpi .v {
      font-size: 24px;
      font-weight: 800;
      font-family: 'Syne', sans-serif;
      margin-top: 10px;
    }

.last-updated {
      font-size: 12px;
      color: var(--muted);
    }

.preset-btn.active {
      background: var(--primary-soft);
      border-color: var(--primary);
      color: var(--primary);
    }

.preset-btn:hover {
      border-color: var(--primary);
      color: var(--primary);
      background: var(--primary-soft);
    }

.state-box {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      padding: 64px 24px;
      color: var(--muted);
      text-align: center;
    }

.state-box p {
      margin: 0;
      font-size: 15px;
    }

.state-box small {
      font-size: 13px;
      opacity: .75;
    }

.state-box svg {
      opacity: .35;
    }

.sub {
      color: var(--muted);
      margin-top: 4px;
      font-size: 14px;
    }

.top-actions {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
    }

.webhook-bar input {
      flex: 1;
      padding: 8px 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--divider);
      font-family: 'DM Sans', monospace;
      font-size: 13px;
      color: var(--muted);
      outline: none;
      cursor: not-allowed;
    }

.webhook-bar label {
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .07em;
      color: #9a9891;
      white-space: nowrap;
    }

.webhook-lock {
      font-size: 11px;
      color: var(--muted);
      display: flex;
      align-items: center;
      gap: 4px;
      white-space: nowrap;
    }

.webhook-lock svg {
      width: 13px;
      height: 13px;
    }

h1 {
      margin: 0;
      font-family: 'Syne', sans-serif;
      font-size: 28px;
      font-weight: 800;
      letter-spacing: -.01em;
    }


/* ===== Skeleton loaders / dropdown de contas / spinner (painéis com filtro de conta) ===== */

.date-bar label {
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .07em;
      color: #9a9891;
      white-space: nowrap;
    }

.skel {
      background: linear-gradient(90deg, #e8e6e1 25%, #f0ede8 50%, #e8e6e1 75%);
      background-size: 200% 100%;
      animation: shimmer 1.4s infinite;
      border-radius: 6px;
      height: 1em;
    }

.skel-m {
      height: .9em;
      width: 90%;
      margin-top: 8px;
    }

.skel-v {
      height: 1.6em;
      width: 70%;
      margin-top: 10px;
    }

.spinner-ring {
      width: 40px;
      height: 40px;
      border: 3px solid var(--border);
      border-top-color: var(--primary);
      border-radius: 50%;
      animation: spin .8s linear infinite;
    }

.account-dropdown {
      display: none;
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      min-width: 240px;
      max-height: 280px;
      overflow-y: auto;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      box-shadow: var(--shadow);
      padding: 8px;
      z-index: 30;
    }

.account-dropdown-divider {
      height: 1px;
      background: var(--divider);
      margin: 6px 0;
    }

.account-dropdown-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 7px 8px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 13px;
    }

.account-dropdown-item input[type="checkbox"] {
      cursor: pointer;
      accent-color: var(--primary);
    }

.account-dropdown-item label {
      cursor: pointer;
      flex: 1;
      text-transform: none;
      letter-spacing: normal;
      font-weight: 500;
      color: var(--text);
    }

.account-dropdown-item:hover {
      background: var(--primary-soft);
    }

.account-dropdown.open {
      display: block;
    }

.account-selector {
      position: relative;
    }


/* ===== Variações com valor padrão (páginas específicas sobrescrevem quando necessário) ===== */

.date-divider {
      width: 1px;
      height: 20px;
      background: var(--border);
      flex-shrink: 0;
    }

.kpis {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 14px;
      margin-bottom: 14px;
    }

.preset-btn {
      padding: 5px 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--bg);
      font-family: 'DM Sans', sans-serif;
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
      cursor: pointer;
      transition: all .15s;
    }

/* .top só define margin-bottom no shared.css; garantimos aqui que os
       botões de ação fiquem alinhados à direita */
    .top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 16px;
    }

.webhook-bar {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 18px;
      padding: 14px 16px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius);
    }

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


/* ===== Animações ===== */

@keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

@keyframes shimmer {
      to {
        background-position: -200% 0;
      }
    }


/* ============================================================
   Padrões compartilhados entre painéis (consolidado do refactor)
   Regras abaixo eram duplicadas em 2+ páginas de painel/dashboard;
   centralizadas aqui porque todas essas páginas já carregam
   dashboard.css. Overrides específicos continuam nos CSS de página.
   ============================================================ */

.kpi .v.success {
      color: var(--success);
    }

.kpi .v.error {
      color: var(--error);
    }

.section-title .n {
      font-size: 11px;
      font-weight: 700;
      color: var(--primary);
      background: var(--primary-soft);
      padding: 2px 8px;
      border-radius: 999px;
    }

.charts-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      margin-bottom: 14px;
    }

.charts-grid-3 {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
      margin-bottom: 14px;
    }

.chart-card .ch-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
    }

.chart-wrap {
      position: relative;
      height: 260px;
    }

.chart-wrap.tall {
      height: 320px;
    }

.table-card th,
    .table-card td {
      padding: 14px 16px;
      border-bottom: 1px solid var(--divider);
      vertical-align: middle;
      text-align: left;
      font-size: 13px;
    }

.table-card th {
      position: sticky;
      top: 0;
      background: var(--surface);
      z-index: 1;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: .07em;
      color: #9a9891;
      font-weight: 700;
    }

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

.table-card tbody tr {
      transition: background .12s;
    }

.table-card tbody tr:hover {
      background: rgba(1, 105, 111, .03);
    }

.name {
      font-weight: 700;
      font-size: 14px;
    }

.pill {
      display: inline-block;
      font-size: 11px;
      font-weight: 700;
      padding: 3px 9px;
      border-radius: 999px;
    }

.pill-success {
      background: var(--success-soft);
      color: var(--success);
    }

.pill-warn {
      background: var(--warning-soft);
      color: var(--warning);
    }

.pill-error {
      background: var(--error-soft);
      color: var(--error);
    }

.pill-muted {
      background: rgba(111, 108, 101, .1);
      color: var(--muted);
    }

.bar-mini {
      display: flex;
      align-items: center;
      gap: 8px;
    }

.bar-mini-bg {
      flex: 1;
      background: rgba(1, 105, 111, .1);
      height: 6px;
      border-radius: 3px;
      overflow: hidden;
    }

.bar-mini-fill {
      background: var(--primary);
      height: 100%;
      border-radius: 3px;
    }

.bar-mini-val {
      font-size: 12px;
      color: var(--muted);
      min-width: 32px;
      text-align: right;
    }

.origin-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: var(--primary-soft);
      color: var(--primary);
      font-size: 12px;
      font-weight: 700;
      flex-shrink: 0;
    }

.funnel-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 18px;
    }

.sankey-container svg {
      max-width: none;
    }

.funnel-note {
      font-size: 12px;
      color: var(--muted);
      margin-top: 12px;
    }

.date-input::-webkit-calendar-picker-indicator {
      cursor: pointer;
      opacity: .6;
    }

/* .top só define margin-bottom no shared.css global; aqui garantimos o
       layout em linha com o título à esquerda e as ações à direita. */
    .top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 16px;
    }

/* ── Seletor de contas ── */
    .account-selector {
      position: relative;
    }

.section-title {
      font-family: 'Syne', sans-serif;
      font-size: 15px;
      font-weight: 800;
      margin: 30px 0 12px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

.chart-card {
      padding: 18px 18px 10px;
    }

.chart-card .ch-sub {
      font-size: 12px;
      color: var(--muted);
      margin-top: 2px;
      margin-bottom: 10px;
    }

.chart-card-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
      flex-wrap: wrap;
    }

.chart-type-toggle {
      display: flex;
      gap: 4px;
      padding: 3px;
      border-radius: 10px;
      background: var(--surface);
      border: 1px solid var(--border);
      flex-shrink: 0;
    }

.chart-type-btn {
      padding: 5px 12px;
      border-radius: 7px;
      border: none;
      background: transparent;
      font-family: 'DM Sans', sans-serif;
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
      cursor: pointer;
      transition: all .15s;
    }

.chart-type-btn:hover {
      color: var(--primary);
    }

.chart-type-btn.active {
      background: var(--primary);
      color: #fff;
    }
