  /* Light mode desabilitado (2026-04-24) — oculta toggle em TODAS as rotas */
  #light-mode-btn, #mobile-theme-btn { display: none !important; }

  /* Google Picker — força ficar acima dos modais (z-index 9999) */
  .picker-dialog-bg { z-index: 100000 !important; }
  .picker-dialog { z-index: 100001 !important; }

  :root {
    --bg: #0a0a0f;
    --surface: #111118;
    --surface2: #1a1a24;
    /* Borda canônica: branco 6% (sem azul, sutil — padrão do RT Premium). 2026-04-24.
       Aplica em tudo que usa var(--border). */
    --border: rgba(255,255,255,0.06);
    --accent: #38BDF8;
    --accent2: #5AD7FF;
    --green: #10b981;
    --red: #ef4444;
    --danger: #ef4444;
    --yellow: #f59e0b;
    --text: #e8e8f0;
    --muted: #6b6b8a;
    --font: 'Roboto', sans-serif;
    --mono: 'Segoe UI', system-ui, sans-serif;
    --bg2: #111118;
    --bg3: #1a1a24;
    --text1: #e8e8f0;
    --text2: #6b6b8a;
    --border-row: rgba(255,255,255,0.06);
    --border-cell: rgba(255,255,255,0.04);
  }
  body.light-mode {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface2: #f0f0f4;
    /* Light mode: preto 6% mirror (light desabilitado, fallback) */
    --border: rgba(0,0,0,0.06);
    --text: #1a1a2e;
    --muted: #6b6b8a;
    --bg2: #ffffff;
    --bg3: #f0f0f4;
    --text1: #1a1a2e;
    --text2: #6b6b8a;
    --border-row: rgba(0,0,0,0.08);
    --border-cell: rgba(0,0,0,0.05);
  }
  body.light-mode .rt-table tbody tr:hover { background:rgba(0,0,0,0.04) !important; transition:background 0.1s; }
  body.light-mode .sidebar {
    background:
      radial-gradient(ellipse 200% 140% at 50% 50%,
        rgba(56,189,248,0.08) 0%,
        rgba(56,189,248,0.04) 35%,
        rgba(56,189,248,0.01) 65%,
        transparent 100%),
      #ffffff;
    border-right-color: #d8d8e0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.05);
  }
  body.light-mode .nav-item.active { background: rgba(79,110,247,0.1); }
  body.light-mode .topbar { background: #ffffff; border-bottom-color: #d8d8e0; }
  /* Light mode: borders, separators, scrollbar */
  body.light-mode .rt-table th { background: #f0f0f4 !important; color: #555 !important; border-color: #d8d8e0 !important; }
  body.light-mode .rt-table td { border-color: #e8e8ec !important; }
  body.light-mode .rt-table td span[style*="color:var(--muted)"] { color: #999 !important; }
  body.light-mode .rt-preset { background: transparent; color: #666; border-color: transparent; }
  body.light-mode .rt-preset:hover, body.light-mode .rt-preset.active { background: var(--accent); color: #fff; }
  body.light-mode .csel-menu { background: #fff; border-color: #d8d8e0; }
  body.light-mode .csel-display { background: #f0f0f4; border-color: #d8d8e0; color: #333; }
  body.light-mode .csel-opt:hover { background: #f0f0f4; }
  body.light-mode .account-info { border-top-color: #d8d8e0; }
  body.light-mode .btn-logout { color: #999; }
  body.light-mode .page-title { color: #1a1a2e; }
  body.light-mode .page-sub { color: #888; }
  body.light-mode .card-title { color: #666; }
  body.light-mode .input, body.light-mode input[type="text"], body.light-mode select { background: #f5f5f7; border-color: #d8d8e0; color: #333; }
  body.light-mode .cal-display { background: #f5f5f7 !important; border-color: #d8d8e0 !important; color: #333 !important; }
  /* Funnel arrow & stats cards */
  body.light-mode #rt-funnel-arrow-card, body.light-mode #rt-funnel-card { background: #fff; }
  body.light-mode #rt-stats .card { background: #fff; }
  body.light-mode #live-map-card { background: #fff; }
  body.light-mode #live-map-us > div { background: #f0f0f4 !important; border-color: #d8d8e0 !important; }
  body.light-mode #us-map-dark { display: none !important; }
  body.light-mode #us-map-light { display: block !important; }
  body.light-mode #sidebar-logo-dark { display: none !important; }
  body.light-mode #sidebar-logo-light { display: block !important; }
  body.light-mode #live-map-empty { color: #999 !important; }
  /* Light mode: table inline borders override */
  body.light-mode .rt-table td, body.light-mode .rt-table th { border-color: #e0e0e6 !important; }
  body.light-mode .rt-table tbody tr { background: transparent; }
  body.light-mode .rt-table tbody tr:nth-child(even):not([style*="background"]) { background: #f8f8fc; }
  /* Stats cards text */
  body.light-mode #rt-stats span[style*="font-weight:800"], body.light-mode #rt-stats span[style*="font-weight: 800"] { color: #1a1a2e !important; }
  /* Live map states/intl */
  body.light-mode #live-us-states-list div, body.light-mode #live-intl-list div { color: #333; }
  body.light-mode #live-count { color: #1a1a2e !important; }
  /* Scrollbar */
  body.light-mode ::-webkit-scrollbar-track { background: #f0f0f4; }
  body.light-mode ::-webkit-scrollbar-thumb { background: #ccc; }
  /* Hourly chart card */
  body.light-mode #rt-hourly-chart-card, body.light-mode #rt-funnel-card { background: #fff; }
  body.light-mode #rt-hourly-chart-title { color: #666 !important; }
  /* Toggles mais visíveis no modo claro */
  body.light-mode .meta-toggle-track { background: #ccc !important; }
  body.light-mode .meta-toggle-track::after { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
  body.light-mode .meta-toggle.active .meta-toggle-track { background: #22c55e !important; }
  body.light-mode .meta-toggle.loading .meta-toggle-track { background: #f59e0b !important; }
  body.light-mode .meta-toggle.unknown .meta-toggle-track { background: #ddd !important; }
  /* Presets e seletores mais visíveis no modo claro */
  body.light-mode .rt-preset { color: #555 !important; }
  body.light-mode .rt-preset.active { color: #fff !important; }
  body.light-mode #page-redtrack .page-header div[style*="background:var(--surface2)"] { background: #e0e0e6 !important; border-color: #ccc !important; }
  body.light-mode .csel-display { background: #e0e0e6 !important; border-color: #ccc !important; color: #333 !important; }
  body.light-mode .csel-menu { background: #fff !important; border-color: #ccc !important; }
  body.light-mode .csel-opt { color: #333 !important; }
  body.light-mode .csel-opt:hover { background: #e8e8ec !important; }
  body.light-mode .csel-opt.active { background: var(--accent) !important; color: #fff !important; }
  body.light-mode div[style*="background:var(--surface2);border-radius:8px;padding:3px"] { background: #e0e0e6 !important; border-color: #ccc !important; }

  * { margin:0; padding:0; box-sizing:border-box; }
  input, select, textarea, button { font-family: var(--font) !important; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* ── LOGIN ── */
  #login-screen {
    display: none; /* começa oculto — JS mostra só se check-auth falhar (evita flash em MPA) */
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at 30% 50%, #1a1040 0%, var(--bg) 60%);
  }
  #login-screen.visible { display: flex; }

  .login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px 40px 40px;
    width: 380px;
    text-align: center;
    box-shadow: 0 40px 80px rgba(0,0,0,0.6);
  }

  .login-logo {
    width: 200px; height: auto;
    background: none;
    border-radius: 0;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
  }
  @media(max-width:480px) {
    .login-card { width:90vw; padding:32px 24px; }
    .login-logo { width:140px; height:140px; }
  }

  .login-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
  .login-card p { color: var(--muted); font-size: 14px; margin-bottom: 32px; }

  .input-group {
    position: relative;
    margin-bottom: 16px;
  }

  .input-group input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
  }

  .input-group input:focus { border-color: var(--accent); }

  .btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    border-radius: 10px;
    padding: 14px;
    color: white;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
  }

  .btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
  .btn-primary:active { transform: translateY(0); }
  .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

  .error-msg {
    color: var(--red);
    font-size: 13px;
    margin-top: 12px;
    display: none;
  }

  /* ── MAIN APP ── */
  #app { display: none; }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 240px;
    /* Sidebar canônico: Premium centralizado (radial gradient em accent) */
    background:
      radial-gradient(ellipse 200% 140% at 50% 50%,
        rgba(56,189,248,0.12) 0%,
        rgba(56,189,248,0.06) 35%,
        rgba(56,189,248,0.02) 65%,
        transparent 100%),
      linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%),
      var(--surface);
    box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 4px 0 20px rgba(0,0,0,0.3);
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    z-index: 100;
  }

  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    flex-shrink: 0;
  }

  #sidebar-nav {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
  }

  #sidebar-nav::-webkit-scrollbar { width: 4px; }
  #sidebar-nav::-webkit-scrollbar-track { background: transparent; }
  #sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
  #sidebar-nav::-webkit-scrollbar-thumb:hover { background: var(--muted); }

  .logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
  }

  .logo-text { font-weight: 800; font-size: 22px; line-height: 1.2; }
  .logo-sub { font-size: 12px; color: var(--muted); font-weight: 400; }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 24px;
    cursor: pointer;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    margin: 2px 0;
  }

  .nav-item:hover { color: var(--accent); background: rgba(79,110,247,0.08); }
  .nav-item.active { color: var(--accent); background: rgba(79,110,247,0.08); border-left-color: var(--accent); }
  .nav-section-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; color:var(--muted); padding:14px 20px 4px; opacity:0.7; user-select:none; }
  .nav-group .nav-item { margin-bottom: 0; }
  .nav-submenu { display: none; }
  .nav-group.open .nav-submenu { display: block; }
  .nav-group.open .nav-chevron { transform: rotate(180deg); }
  .nav-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px 10px 42px;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
  }
  .nav-sub-item:hover { color: var(--accent); background: rgba(79,110,247,0.08); }
  .nav-sub-item.active { color: var(--accent); background: rgba(79,110,247,0.08); border-left-color: var(--accent); }
  .nav-icon { font-size: 20px; width: 22px; text-align: center; }

  .nav-section {
    padding: 16px 24px 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .sidebar-footer {
    margin-top: auto;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }

  .account-info {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px;
  }

  .account-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800;
    flex-shrink: 0;
  }

  .account-name { font-weight: 600; font-size: 13px; }
  .account-tz { font-size: 11px; color: var(--muted); }

  .btn-logout {
    background: none; border: none;
    color: var(--muted); cursor: pointer;
    font-size: 18px; margin-left: auto;
    transition: color 0.2s;
  }
  .btn-logout:hover { color: var(--red); }

  /* ── CONTENT ── */
  .content {
    margin-left: 240px;
    min-height: 100vh;
    padding: 32px;
  }

  .page { display: none; }
  .page.active { display: block; }

  .page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
  }

  .page-title { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; font-family: 'Sora', var(--font); }
  .page-sub { color: var(--muted); font-size: 15px; margin-top: 4px; }

  /* ── CARDS ── */
  .card {
    /* Card canônico: Premium centralizado (radial + linear gradient + shadow + accent border) */
    background:
      radial-gradient(ellipse 130% 80% at 50% 50%, rgba(56,189,248,0.10), transparent 75%),
      linear-gradient(180deg, rgba(255,255,255,0.04), transparent 50%),
      var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow:
      0 1px 0 rgba(255,255,255,0.06) inset,
      0 6px 20px rgba(0,0,0,0.5),
      0 2px 4px rgba(0,0,0,0.3);
  }
  body.light-mode .card {
    background:
      radial-gradient(ellipse 130% 80% at 50% 50%, rgba(56,189,248,0.06), transparent 75%),
      linear-gradient(180deg, rgba(255,255,255,0.5), transparent 50%),
      var(--surface);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.8) inset,
      0 4px 12px rgba(0,0,0,0.06),
      0 1px 2px rgba(0,0,0,0.04);
  }

  .card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
  }

  /* ── KPI BAR ── */
  .kpi-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
  }
  .kpi-item {
    background: var(--surface);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background .15s;
  }
  .kpi-item:hover { background: var(--surface2); }
  .kpi-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
  .kpi-value { font-size: 22px; font-weight: 800; font-family: var(--mono); color: var(--text); line-height: 1.1; }
  .kpi-sub   { font-size: 11px; color: var(--muted); }
  .kpi-pos   { color: #22c55e; }
  .kpi-neg   { color: #ef4444; }
  @media(max-width:700px) { .kpi-bar { grid-template-columns: repeat(3,1fr); } }
  @media(max-width:480px) { .kpi-bar { grid-template-columns: repeat(2,1fr); } }
  .card-collapse-btn {
    background: none; border: 1px solid var(--border); color: var(--muted);
    width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
    font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: border-color .15s, color .15s;
  }
  .card-collapse-btn:hover { border-color: var(--accent); color: var(--accent); }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-card {
    /* Stat card canônico: mesma base do .card (Premium) */
    background:
      radial-gradient(ellipse 130% 80% at 50% 50%, rgba(56,189,248,0.10), transparent 75%),
      linear-gradient(180deg, rgba(255,255,255,0.04), transparent 50%),
      var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    transition: border-color 0.2s;
    box-shadow:
      0 1px 0 rgba(255,255,255,0.06) inset,
      0 6px 20px rgba(0,0,0,0.5),
      0 2px 4px rgba(0,0,0,0.3);
  }
  body.light-mode .stat-card {
    background:
      radial-gradient(ellipse 130% 80% at 50% 50%, rgba(56,189,248,0.06), transparent 75%),
      linear-gradient(180deg, rgba(255,255,255,0.5), transparent 50%),
      var(--surface);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.8) inset,
      0 4px 12px rgba(0,0,0,0.06),
      0 1px 2px rgba(0,0,0,0.04);
  }
  .stat-card:hover { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }

  .stat-label { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
  .stat-value { font-size: 34px; font-weight: 800; margin-top: 6px; font-family: var(--mono); }
  .stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

  /* ── CAMPAIGN LIST ── */
  .campaign-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
  }

  .campaign-list::-webkit-scrollbar { width: 4px; }
  .campaign-list::-webkit-scrollbar-track { background: var(--surface); border-radius: 4px; }
  .campaign-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
  .campaign-list::-webkit-scrollbar-thumb:hover { background: var(--accent); }

  .campaign-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
  }

  .campaign-item:hover { border-color: var(--accent); background: rgba(79,110,247,0.06); }
  .campaign-item.selected { border-color: var(--accent); background: rgba(79,110,247,0.1); }

  .campaign-check {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    transition: all 0.15s;
  }

  .campaign-item.selected .campaign-check {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
  }

  .campaign-name { font-size: 14px; font-weight: 600; flex: 1; }
  .campaign-badge {
    font-size: 11px; font-weight: 700;
    padding: 3px 8px; border-radius: 20px;
    background: rgba(16,185,129,0.1); color: var(--green);
  }

  /* ── FORMS ── */
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
  .form-group { display: flex; flex-direction: column; gap: 6px; }
  .form-group.full { grid-column: 1 / -1; }

  label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

  input[type="text"], input[type="number"], input[type="time"], input[type="date"],
  input[type="password"], input[type="email"], input[type="url"], input[type="search"],
  select, textarea {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    color-scheme: dark;
  }

  input:focus, select:focus, textarea:focus { border-color: var(--accent); }

  ::-webkit-calendar-picker-indicator { filter: invert(0.7); cursor: pointer; }

  .time-drop {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    margin-top: 2px;
    padding: 8px;
  }
  .time-drop-cols {
    display: flex;
    gap: 8px;
  }
  .time-drop-col {
    flex: 1;
    max-height: 200px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .time-drop-col::-webkit-scrollbar { width: 4px; }
  .time-drop-col::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
  .time-drop-item {
    padding: 6px 10px;
    text-align: center;
    font-size: 13px;
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    transition: background .1s;
  }
  .time-drop-item:hover { background: rgba(79,110,247,.15); }
  .time-drop-item.active { background: rgba(79,110,247,.2); color: var(--accent); font-weight: 600; }

  /* ── CALENDAR PICKER ── */
  .cal-drop {
    display:none; position:absolute; top:calc(100% + 4px); left:0; z-index:100;
    background:var(--surface); border:1px solid var(--border); border-radius:12px;
    box-shadow:0 12px 40px rgba(0,0,0,.5); padding:12px; width:280px;
    user-select:none;
  }
  .cal-drop.open { display:block; }
  .cal-header {
    display:flex; align-items:center; justify-content:space-between; margin-bottom:10px;
  }
  .cal-header span { font-size:14px; font-weight:700; color:var(--text); }
  .cal-header button {
    background:none; border:none; color:var(--muted); font-size:18px; cursor:pointer;
    width:28px; height:28px; border-radius:6px; display:flex; align-items:center; justify-content:center;
    transition:background .15s;
  }
  .cal-header button:hover { background:var(--surface2); color:var(--text); }
  .cal-grid {
    display:grid; grid-template-columns:repeat(7,1fr); gap:2px; text-align:center;
  }
  .cal-grid .cal-dow {
    font-size:11px; font-weight:600; color:var(--muted); padding:4px 0;
    text-transform:uppercase; letter-spacing:.5px;
  }
  .cal-grid .cal-day {
    font-size:13px; padding:6px 0; border-radius:8px; cursor:pointer; color:var(--text);
    transition:background .12s, color .12s;
  }
  .cal-grid .cal-day:hover { background:var(--surface2); }
  .cal-grid .cal-day.today { color:var(--accent); font-weight:700; }
  .cal-grid .cal-day.selected { background:var(--accent); color:#fff; font-weight:700; }
  .cal-grid .cal-day.other { color:var(--muted); opacity:.4; }
  .cal-quick {
    display:flex; gap:6px; margin-top:8px; padding-top:8px; border-top:1px solid var(--border);
  }
  .cal-quick button {
    flex:1; background:var(--surface2); border:1px solid var(--border); border-radius:6px;
    color:var(--text); font-size:11px; padding:5px 0; cursor:pointer; transition:background .15s;
  }
  .cal-quick button:hover { background:var(--border); }

  select option { background: var(--surface2); }

  /* ── DESIGN SYSTEM: Dropdown (.s1) ── */
  .s1 { position: relative; }
  .s1-btn {
    width: 100%;
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 15px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 14px; font-weight: 600;
    color: var(--muted);
    transition: background .2s, border-color .2s, color .2s;
    user-select: none;
    gap: 10px;
  }
  .s1-btn:hover { background: var(--surface2); border-color: rgba(56,189,248,0.2); color: var(--text); }
  .s1-btn.open  { border-color: rgba(56,189,248,0.35); color: var(--text); }
  .s1-btn .chev {
    flex-shrink: 0; font-size: 9px;
    color: var(--muted);
    transition: transform .25s, color .2s;
  }
  .s1-btn.open .chev { transform: rotate(180deg); color: var(--accent); }
  .s1-menu {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 99;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,0.45);
    opacity: 0; transform: translateY(-6px) scale(.98);
    pointer-events: none;
    transition: opacity .2s, transform .2s;
  }
  .s1-menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
  .s1-menu .s1-search {
    width: 100%; padding: 10px 15px; border: none; border-bottom: 1px solid var(--border);
    background: var(--surface); color: var(--text); font-family: var(--font);
    font-size: 13px; outline: none;
  }
  .s1-menu .s1-search::placeholder { color: var(--muted); }
  .s1-menu .s1-list { max-height: 240px; overflow-y: auto; }
  .s1-menu .s1-section {
    padding: 6px 15px; font-size: 10px; color: var(--muted); font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
  }
  .s1-opt {
    padding: 10px 15px;
    font-size: 14px; font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--border);
    transition: background .12s, color .12s;
    position: relative;
  }
  .s1-opt:last-child { border-bottom: none; }
  .s1-opt::before {
    content: '';
    width: 3px; height: 0;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
    flex-shrink: 0;
    margin-left: -15px;
    margin-right: 12px;
    transition: height .2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 8px rgba(56,189,248,0.25);
  }
  .s1-opt:hover::before, .s1-opt.sel::before { height: 16px; }
  .s1-opt:hover { background: var(--surface2); color: var(--text); }
  .s1-opt.sel { color: var(--accent); background: rgba(56,189,248,0.10); font-weight: 700; }
  .s1-opt.recent { background: rgba(56,189,248,0.04); }

  /* ── BUTTONS ── */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
  }

  .btn:disabled { opacity: 0.4; cursor: not-allowed; }

  .btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; }
  .btn-accent:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }

  .btn-ghost { background: var(--surface2); border: 1px solid var(--border); color: var(--text); }
  .btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

  .btn-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
  .btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.2); }

  .btn-green { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: var(--green); }
  .btn-green:hover:not(:disabled) { background: rgba(16,185,129,0.2); }

  /* ── ACTION BAR ── */
  .action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
  }

  .select-all {
    font-size: 13px; color: var(--accent);
    cursor: pointer; font-weight: 600;
  }

  /* ── PREVIEW TABLE ── */
  .preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }

  .preview-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
  }

  .preview-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(42,42,58,0.5);
    font-family: var(--mono);
    font-size: 12px;
  }

  .preview-table tr:last-child td { border-bottom: none; }

  .change-arrow { color: var(--accent); margin: 0 6px; }
  .text-green { color: var(--green); }
  .text-red { color: var(--red); }
  .text-muted { color: var(--muted); }

  /* ── MONITOR ── */
  .monitor-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: var(--surface2);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
  }

  .status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
  }

  .status-dot.running {
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
    50% { box-shadow: 0 0 0 6px rgba(16,185,129,0.05); }
  }
  @keyframes livePulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(1.3)} }
  @keyframes liveDot { 0%,100%{opacity:1} 50%{opacity:.3} }
  @keyframes liveDotGlow { 0%,100%{opacity:.5} 50%{opacity:.15} }

  .status-text { font-weight: 700; font-size: 14px; }
  .status-sub { font-size: 12px; color: var(--muted); margin-left: auto; font-family: var(--mono); }

  .log-container {
    background: #070710;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    height: 280px;
    overflow-y: auto;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.8;
  }

  .log-line { color: #8888aa; }
  .log-line.success { color: var(--green); }
  .log-line.error { color: var(--red); }
  .log-line.warning { color: var(--yellow); }
  .log-line.info { color: var(--accent); }

  /* ── REDTRACK TABLE ── */
  /* Tabela RT canônica: pílulas com cores pos/neg (border-spacing vertical, bg herdado pela tr). */
  .rt-table { width:100%; border-spacing:0 6px; border-collapse:separate; font-size:14px; font-family:var(--mono); table-layout:auto; }
  .rt-table th {
    background:transparent; color:var(--muted); font-weight:600;
    padding:9px 12px; text-align:right; white-space:nowrap;
    border:0;
    cursor:pointer; user-select:none;
    font-size:14px; letter-spacing:0.04em; text-transform:none;
    position:relative;
  }
  .rt-table th:first-child { text-align:center; width:50px; padding:7px 4px; }
  .rt-table th:last-child { border-right:none; }
  .rt-table th:hover { color:var(--text); }
  .rt-resize-handle {
    position:absolute; right:0; top:0; bottom:0; width:5px;
    cursor:col-resize; z-index:1;
  }
  .rt-resize-handle:hover, .rt-resize-handle.resizing { background:var(--accent); opacity:0.5; }
  /* Row pills canônico: td transparente herda bg da tr (que tem surface2 ou cor pos/neg inline) */
  .rt-table tbody tr:not(.rt-nicho-divider):not([style*="background"]) { background: var(--surface2); }
  body.light-mode .rt-table tbody tr:not(.rt-nicho-divider):not([style*="background"]) { background: #f3f3f7; }
  .rt-table td {
    padding:10px 12px; border:0; background:inherit;
    text-align:right; white-space:nowrap; color:var(--text); font-size:14px;
    font-variant-numeric: tabular-nums;
  }
  .rt-table tbody tr:not(.rt-nicho-divider) td:first-child { border-radius:8px 0 0 8px; }
  .rt-table tbody tr:not(.rt-nicho-divider) td:last-child { border-radius:0 8px 8px 0; }
  .rt-table td:first-child { text-align:center; padding:6px 4px; }
  .rt-table td[data-col="rt_campaign"] { text-align:left; position:relative; overflow:visible !important; }
  /* RT Quick Actions — dots inside campaign name cell, right-aligned */
  .rt-qa-dots { display:none; position:absolute; right:4px; top:50%; transform:translateY(-50%); background:var(--surface); border:none; cursor:pointer; color:var(--muted); padding:2px 6px; border-radius:6px; font-size:18px; line-height:1; letter-spacing:2px; z-index:10; }
  .rt-qa-dots:hover { background:var(--surface2); color:var(--text); }
  .rt-table td[data-col="rt_campaign"]:hover .rt-qa-dots { display:inline-block; }
  /* Dropdown menu — fixed position, set by JS */
  .rt-qa-drop { display:none; position:fixed; z-index:9000; background:var(--surface); border:1px solid var(--border); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.4); padding:6px; min-width:170px; }
  .rt-qa-drop.open { display:block; }
  .rt-qa-btn { display:flex; align-items:center; gap:8px; padding:8px 12px; border-radius:7px; font-size:12px; font-weight:600; color:var(--text); cursor:pointer; border:none; background:none; transition:background .15s; width:100%; text-align:left; }
  .rt-qa-btn:hover { background:var(--surface2); }
  .rt-qa-btn svg { width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:1.75; flex-shrink:0; }
  /* Quick Action Modal */
  .qa-modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:9990; align-items:center; justify-content:center; }
  .qa-modal-overlay.open { display:flex; }
  .qa-modal { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:24px; width:480px; max-width:95vw; max-height:85vh; overflow-y:auto; box-shadow:0 12px 40px rgba(0,0,0,.4); }
  .qa-modal-title { font-size:16px; font-weight:700; margin-bottom:16px; display:flex; align-items:center; justify-content:space-between; }
  .qa-modal-close { background:none; border:none; color:var(--muted); cursor:pointer; font-size:20px; padding:0 4px; }
  .qa-modal-close:hover { color:var(--text); }
  .qa-modal-camp { font-size:12px; color:var(--muted); background:var(--surface2); padding:8px 12px; border-radius:8px; margin-bottom:16px; word-break:break-all; font-family:var(--mono); }
  .qa-modal .form-group { margin-bottom:14px; }
  .qa-modal .form-group label { display:block; font-size:12px; font-weight:600; color:var(--muted); margin-bottom:4px; text-transform:uppercase; letter-spacing:.04em; }
  .qa-modal input, .qa-modal select { width:100%; padding:10px 12px; font-size:13px; border-radius:8px; border:1px solid var(--border); background:var(--bg); color:var(--text); }
  .qa-modal .btn-primary { width:100%; padding:12px; font-size:14px; font-weight:700; border:none; border-radius:10px; background:var(--accent); color:#fff; cursor:pointer; margin-top:8px; }
  .qa-modal .btn-primary:hover { filter:brightness(1.1); }
  .rt-table td:nth-child(2) { text-align:left; }
  .rt-table td:last-child { border-right:none; }
  /* Hover: overlay accent preservando cor pos/neg via box-shadow inset */
  .rt-table tbody tr:not(.rt-nicho-divider):hover td { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--accent) 10%, transparent); transition: box-shadow 0.1s; }
  .rt-nicho-divider td { background:rgba(255,255,255,0.04); border-bottom:1px solid var(--border); padding:6px 10px !important; text-align:left !important; }
  .rt-nicho-divider:not(:first-child) td { border-top:2px solid var(--border); }
  .rt-nicho-label { font-weight:700; font-size:13px; color:var(--text); margin-right:12px; }
  .rt-nicho-stats { font-size:12px; color:var(--muted); font-weight:400; }
  body.light-mode .rt-nicho-divider td { background:rgba(0,0,0,0.03); }
  .rt-table tbody tr.rt-nicho-divider:hover { background:rgba(255,255,255,0.04); }
  body.light-mode .rt-table tbody tr.rt-nicho-divider:hover { background:rgba(0,0,0,0.03); }
  .rt-th-total { font-size:15px; color:var(--accent); font-weight:700; letter-spacing:0; text-transform:none; }
  /* Top Ads */
  .ads-row { display:grid; grid-template-columns:28px 1fr 80px 80px 70px 54px; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid rgba(255,255,255,0.05); }
  .ads-row:last-child { border-bottom:none; }
  .ads-rank { font-size:12px; font-weight:800; color:var(--muted); text-align:center; }
  .ads-rank.top { color:var(--accent); }
  .ads-name { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ads-bar-wrap { position:relative; height:6px; background:rgba(255,255,255,0.07); border-radius:3px; overflow:hidden; }
  .ads-bar-fill { height:100%; border-radius:3px; background:var(--accent); transition:width .4s; }
  .ads-val { font-size:12px; font-variant-numeric:tabular-nums; text-align:right; }
  .ads-roas { font-size:12px; font-weight:700; text-align:center; border-radius:5px; padding:2px 6px; }
  @media(max-width:600px) { .ads-row { grid-template-columns:22px 1fr 60px 50px; } .ads-row > *:nth-child(5),.ads-row > *:nth-child(6) { display:none; } }
  /* Toggle campanha Meta */
  .meta-toggle { display:inline-flex; align-items:center; margin-right:8px; vertical-align:middle; flex-shrink:0; }
  .meta-toggle input { display:none; }
  .meta-toggle-track {
    width:28px; height:15px; border-radius:8px; background:rgba(255,255,255,0.15);
    position:relative; cursor:pointer; transition:background .2s; flex-shrink:0;
  }
  .meta-toggle-track::after {
    content:''; position:absolute; top:2px; left:2px;
    width:11px; height:11px; border-radius:50%; background:#fff;
    transition:transform .2s;
  }
  .meta-toggle.active .meta-toggle-track { background:#22c55e; }
  .meta-toggle.active .meta-toggle-track::after { transform:translateX(13px); }
  .meta-toggle.loading .meta-toggle-track { background:#f59e0b; cursor:wait; }
  .meta-toggle.unknown .meta-toggle-track { background:rgba(255,255,255,0.08); cursor:default; }
  .rt-datepicker { position:relative; }
  .rt-datepicker-btn {
    display:flex; align-items:center; gap:8px; padding:8px 14px;
    border-radius:8px; border:1px solid var(--border); background:var(--surface2);
    color:var(--text); font-size:13px; cursor:pointer; white-space:nowrap;
    font-family:var(--font); transition:border-color 0.15s;
  }
  .rt-datepicker-btn:hover { border-color:var(--accent); }
  .rt-datepicker-dropdown {
    display:none; position:absolute; right:0; top:calc(100% + 6px); z-index:200;
    background:var(--surface); border:1px solid var(--border); border-radius:12px;
    padding:16px; min-width:320px; box-shadow:0 8px 32px rgba(0,0,0,0.4);
  }
  .rt-datepicker-dropdown.open { display:block; }
  .rt-preset-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-bottom:14px; }
  .rt-preset {
    padding:7px 10px; border-radius:7px; border:1px solid var(--border);
    background:var(--surface2); color:var(--muted); font-size:12px; font-weight:600;
    cursor:pointer; text-align:center; font-family:var(--font); transition:all 0.12s;
  }
  .rt-preset:hover, .rt-preset.active { background:var(--accent); color:#fff; border-color:var(--accent); }
  .rt-date-inputs { display:flex; gap:8px; align-items:center; margin-bottom:12px; }
  .rt-date-inputs input {
    flex:1; padding:7px 10px; border-radius:7px; border:1px solid var(--border);
    background:var(--surface2); color:var(--text); font-size:12px; font-family:var(--font);
  }
  .rt-date-inputs span { color:var(--muted); font-size:12px; }
  .rt-pos { color:#22c55e; font-weight:600; }
  .rt-neg { color:#f87171; font-weight:600; }
  .rt-zero { color:var(--muted); }
  .rt-stat-icon { display:flex; align-items:center; justify-content:center; width:44px; height:44px; border-radius:12px; background:rgba(79,110,247,0.12); margin:0 auto 10px; color:var(--accent); }
  .rt-stat-icon svg { width:22px; height:22px; }
  #rt-stats .card > div:nth-child(2) { font-family:var(--mono); }
  .campaign-spend, .spend-value, [id^="stat-"] { font-family:var(--mono); }

  /* ── IA CHAT ── */
  .ia-bubble { max-width:88%; padding:10px 14px; border-radius:14px; font-size:13px; line-height:1.6; word-break:break-word; }
  .ia-bubble.user { background:var(--accent); color:#fff; align-self:flex-end; border-bottom-right-radius:4px; }
  .ia-bubble.assistant { background:var(--surface2); color:var(--text); align-self:flex-start; border-bottom-left-radius:4px; }
  .ia-bubble.assistant pre { background:var(--bg); border-radius:8px; padding:8px 12px; margin:6px 0; overflow-x:auto; font-size:12px; }
  .ia-bubble.assistant code { background:var(--bg); border-radius:4px; padding:1px 5px; font-size:12px; }
  .ia-bubble.assistant strong { color:var(--accent); }
  .ia-row { display:flex; flex-direction:column; }
  .ia-typing { display:flex; gap:4px; align-items:center; padding:10px 14px; background:var(--surface2); border-radius:14px; align-self:flex-start; }
  .ia-typing span { width:7px; height:7px; border-radius:50%; background:var(--muted); animation:iaTyping 1.2s infinite; }
  .ia-typing span:nth-child(2) { animation-delay:.2s; }
  .ia-typing span:nth-child(3) { animation-delay:.4s; }
  @keyframes iaTyping { 0%,80%,100%{transform:scale(1);opacity:.5} 40%{transform:scale(1.3);opacity:1} }

  /* ── COST META BADGE ── */
  .cost-cell { display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
  .cost-ts {
    font-size:10px; color:var(--muted); font-family:var(--mono);
    display:flex; align-items:center; gap:3px; line-height:1;
  }
  .cost-ts.stale { color:#f59e0b; }
  .cost-ts svg { flex-shrink:0; }

  /* ── REDTRACK TABLE ── */
  .tabs {
    display: flex;
    gap: 4px;
    background: var(--surface2);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
  }

  .tab {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    background: none;
    color: var(--muted);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
  }

  .tab.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

  .tab-content { display: none; }
  .tab-content.active { display: block; }

  /* ── ALERTS ── */
  .alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }

  .alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: var(--green); }
  .alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: var(--red); }
  .alert-info { background: rgba(79,110,247,0.1); border: 1px solid rgba(79,110,247,0.2); color: var(--accent); }

  /* ── SPINNER ── */
  .spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
  }

  @keyframes spin { to { transform: rotate(360deg); } }

  .loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,10,15,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    display: none;
  }

  .loading-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 40px;
    text-align: center;
  }

  .loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
  }

  .loading-text { font-size: 15px; font-weight: 600; }
  .loading-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }

  /* ── RESULTS LOGS ── */
  .result-logs {
    background: #070710;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.8;
    margin-top: 16px;
  }

  /* ── SCROLLBAR ── */
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: var(--surface); }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--muted); }

  /* ── RESPONSIVE ── */
  /* ── MOBILE HEADER ── */
  .mobile-header {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    height: 64px; background: var(--surface);
    border-bottom: 1px solid var(--border);
    align-items: center; justify-content: space-between;
    padding: 0 16px;
  }
  .mobile-header .logo-text { font-weight: 800; font-size: 15px; }
  .hamburger {
    background: none; border: none; color: var(--text);
    cursor: pointer; padding: 6px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
  }
  .hamburger:hover { background: var(--surface2); }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; z-index: 149;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(2px);
  }
  .sidebar-overlay.open { display: block; }

  /* ── TABLET (1024px) ── */
  @media (max-width: 1024px) {
    .sidebar { width: 200px; }
    .content { margin-left: 200px; padding: 24px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
  }

  /* ── MOBILE (768px) ── */
  @media (max-width: 768px) {
    .mobile-header { display: flex; }
    .sidebar {
      top: 64px; transform: translateX(-100%);
      transition: transform 0.25s ease; z-index: 150;
      width: 260px;
    }
    .sidebar.open { transform: translateX(0); }
    .content { margin-left: 0; padding: 16px; padding-top: 80px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr !important; }
    .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .page-header > div:last-child { width: 100%; flex-wrap: wrap; }
    .page-title { font-size: 20px; }
    #rt-stats { grid-template-columns: repeat(2, 1fr) !important; }
    .rt-datepicker-dropdown { right: auto; left: 0; min-width: 280px; }
    .cascade-board { overflow-x: visible; }
    .inner-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .board-sections { flex-direction: column; }
    .stat-value { font-size: 22px; }
    .card { padding: 14px 16px; }
    .rt-datepicker-btn span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  }

  /* ── RT RESPONSIVO (768px) ── */
  @media (max-width: 768px) {
    /* Mobile header — logo Cortex (SVG wide 4.8:1) */
    .mobile-header img[src*="cortex-logo"] { width: auto !important; height: 40px !important; max-width: 55vw; border-radius: 0 !important; }

    /* Layout principal */
    #rt-warroom { grid-template-columns: 1fr !important; }
    #rt-bottom-row { grid-template-columns: 1fr !important; }
    #rt-table-card { overflow: hidden !important; }
    #rt-table-wrap, #rt-hourly-wrap, #rt-checkouts-wrap, #rt-criativos-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
    .rt-table { min-width: 800px; }
    #page-redtrack { overflow-x: hidden; max-width: 100vw; }
    .content { overflow-x: hidden; }
    #rt-funnel-arrow-card { display: none !important; }

    /* Page header */
    #page-redtrack .page-header > div:last-child { width: 100%; }
    #page-redtrack .page-header { gap: 8px; }
    .rt-actions { gap: 6px !important; }

    /* Pinned tabs scroll-x */
    #rt-pinned-tabs[style*="display:flex"], #rt-pinned-tabs[style*="display: flex"] { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; padding-bottom: 2px; }
    #rt-pinned-tabs::-webkit-scrollbar { height: 0; }

    /* Camp selector linha */
    .rt-camp-row { width: 100%; }
    .rt-camp-row .s1 { flex: 1; min-width: 0 !important; }

    /* Presets bar — scroll-x */
    .rt-presets-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; max-width: 100%; }
    .rt-presets-bar::-webkit-scrollbar { height: 0; }
    .rt-preset { padding: 6px 10px !important; font-size: 11px !important; white-space: nowrap; flex-shrink: 0; }

    /* Datas: full width — De/Até em row 1, botões em row 2 */
    .rt-dates-bar { width: 100%; flex-wrap: wrap; }
    .rt-dates-bar > div[style*="position:relative"] { flex: 1; min-width: 130px; }
    .rt-dates-bar .cal-display { width: 100% !important; }
    .rt-dates-actions { width: 100%; align-items: stretch; }
    .rt-dates-actions > button { height: 34px; }
    .rt-dates-actions > button:first-child { flex: 1; min-width: 0; }

    /* Tabela — tabs internas em scroll-x */
    .rt-table-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; max-width: 100%; }
    .rt-table-tabs::-webkit-scrollbar { height: 0; }
    .rt-table-tabs > button { padding: 7px 12px !important; font-size: 12px !important; flex-shrink: 0; }
    #rt-table-toolbar { width: 100%; }
    #rt-search { flex: 1; min-width: 120px; width: auto !important; }

    /* Stats cards */
    #rt-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 4px !important; }
    #rt-stats .card { min-width: 0 !important; overflow: hidden; }
    #rt-stats .card > div:first-child { font-size: 10px !important; }
    #rt-stats .card > div:nth-child(2) { font-size: 18px !important; }
    #rt-stats .card > div:nth-child(3) { font-size: 9px !important; }
    #rt-stats canvas { display: none !important; }

    /* Live Map */
    #live-map-card { padding: 8px !important; }
    #live-carousel-title { font-size: 11px !important; letter-spacing: 0.5px !important; }
    #live-us-states-list { grid-template-columns: repeat(3, 1fr) !important; height: auto !important; max-height: 200px; }
    #live-intl-list { grid-template-columns: repeat(3, 1fr) !important; max-height: 200px; }
    #live-count { font-size: 17px !important; }

    /* Hourly chart vertical (24h em coluna, barras horizontais) */
    #rt-hourly-chart-wrap { height: 540px !important; }

    /* Card duplo Cliques vs IC + Pitch vs Cards full-width */
    #rt-clicks-stat-card { grid-column: 1 / -1; }

    /* Funil — selectors full width, VS empilha */
    #rt-funnel-card .s1 { min-width: 0 !important; max-width: 100% !important; width: 100%; }
    #funnel-sel1-wrap, #funnel-sel2-wrap { width: 100%; }
    #rt-funnel-container { flex-direction: column !important; gap: 8px !important; }
    #rt-funnel-vs-side { border-left: none !important; border-top: 1px solid var(--border); padding-top: 8px; }

    /* Outras */
    .ora-grid { grid-template-columns: 1fr !important; }
  }

  /* ── SMALL MOBILE (480px) ── */
  @media (max-width: 480px) {
    .content { padding: 12px; padding-top: 76px; }
    .stats-grid { grid-template-columns: 1fr; }

    #page-redtrack .page-sub { display: none; }
    #page-redtrack .page-title { font-size: 18px; }

    /* Page header: empilha botões mas mantém presets/datas em row */
    .page-header > div:last-child > button,
    .page-header > div:last-child > select { width: 100%; }

    /* Stats: já em 2 cols, comprime ainda mais */
    #rt-stats { grid-template-columns: 1fr 1fr !important; }
    #rt-stats .card > div:nth-child(2) { font-size: 16px !important; }

    /* Tabela */
    .rt-preset-grid { grid-template-columns: 1fr 1fr; }
    .rt-table { min-width: 600px; }
    .rt-table td, .rt-table th { padding: 6px 8px; font-size: 12px; }

    /* Live map states 2 cols */
    #live-us-states-list { grid-template-columns: repeat(2, 1fr) !important; }
    #live-intl-list { grid-template-columns: repeat(2, 1fr) !important; }

    /* Hourly chart vertical compacto */
    #rt-hourly-chart-wrap { height: 480px !important; }

    /* Modal Tarefas full-width */
    .td-modal { width: 92vw !important; max-width: 92vw !important; right: 4vw !important; left: 4vw !important; }

    /* Manual conv modal */
    .qa-modal { width: 92vw !important; max-width: 92vw !important; }
  }

  .badge-active { background: rgba(16,185,129,0.1); color: var(--green); padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
  .badge-paused { background: rgba(245,158,11,0.1); color: var(--yellow); padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }

  .divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

  .step-indicator {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
  }

  .step {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    transition: background 0.3s;
  }
  .step.done { background: var(--accent); }
  .step.current { background: var(--accent); opacity: 0.6; }

  /* ── Inner Tabs (Campanhas) ── */
  .inner-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--surface);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
    width: fit-content;
  }
  .inner-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .inner-tab:hover { color: var(--text); background: var(--surface2); }
  .inner-tab.active { background: var(--surface2); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
  .inner-tab i[data-lucide] svg { width: 13px; height: 13px; }
  .camp-tab-content { animation: fadeIn 0.15s ease; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }


  /* ── Cascade Layout (Criar Campanha) ── */
  .cascade-section {
    margin-bottom: 8px;
  }
  .cascade-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 4px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .cascade-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
  }
  .cascade-section .card {
    margin-bottom: 8px;
  }
  .cascade-section .card:last-child {
    margin-bottom: 0;
  }


  /* ── Cascade Boards ── */
  .cascade-board {
    margin-bottom: 18px;
    padding: 0;
    overflow: visible;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  }
  .cascade-board-header {
    border-radius: 14px 14px 0 0;
  }
  .cascade-board-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: rgba(79,110,247,0.10);
    border-bottom: 1px solid var(--border);
  }
  .cascade-board-step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    line-height: 1;
    padding-top: 1px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79,110,247,0.45);
  }
  .cascade-board-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.01em;
  }
  .cascade-board-body {
    padding: 22px 26px;
  }
  .board-section {
    margin-bottom: 24px;
  }
  .board-section:last-child {
    margin-bottom: 0;
  }
  .board-section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
    padding: 6px 10px;
    background: rgba(79,110,247,0.08);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    display: inline-block;
  }
  .pos-label {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; font-weight: normal; color: var(--text);
    text-transform: none; letter-spacing: 0; cursor: pointer;
    padding: 6px 10px; border-radius: 8px; transition: background 0.1s;
  }
  .pos-label:hover { background: var(--surface2); }
  .pos-label input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--border); background: transparent;
    cursor: pointer; position: relative; flex-shrink: 0;
    transition: all 0.15s ease;
  }
  .pos-label input[type="checkbox"]:checked {
    background: var(--accent); border-color: var(--accent);
  }
  .pos-label input[type="checkbox"]:checked::after {
    content: '\2713'; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); color: #fff;
    font-size: 12px; font-weight: 700;
  }
  /* ── Estilo unificado criar campanha ── */
  #camp-tab-criar input[type="text"],
  #camp-tab-criar input[type="number"],
  #camp-tab-criar input[type="time"],
  #camp-tab-criar textarea {
    background: var(--surface2) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    color: var(--text) !important;
    box-shadow: none !important;
    outline: none !important;
  }
  #camp-tab-criar input[type="text"]:focus,
  #camp-tab-criar input[type="number"]:focus,
  #camp-tab-criar input[type="time"]:focus,
  #camp-tab-criar textarea:focus {
    background: var(--bg3) !important;
  }
  /* Esconde selects nativos na aba criar (serão substituídos por custom) */
  #camp-tab-criar select { display: none !important; }
  /* Custom select (substitui <select> nativo) */
  .csel-wrap { position: relative; width: 100%; }
  .page-header .csel-wrap { width: auto; min-width: 160px; }
  .cal-wrap { position: relative; display: inline-block; }
  .cal-display {
    background-color: var(--surface2); border: none; border-radius: 12px;
    padding: 10px 32px 10px 14px; font-size: 13px; color: var(--text);
    cursor: pointer; font-family: var(--font); user-select: none;
    white-space: nowrap; transition: background-color 0.12s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 13px;
  }
  .cal-display:hover { background-color: var(--bg3); }
  .cal-drop {
    display: none; position: absolute; top: calc(100% + 4px); left: 0;
    z-index: 9999; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.4); padding: 12px; min-width: 260px;
    animation: dropSlide 0.14s ease;
  }
  .cal-drop.open { display: block; }
  .cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  .cal-header span { font-size: 13px; font-weight: 600; color: var(--text); }
  .cal-header button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 6px; }
  .cal-header button:hover { background: var(--border); color: var(--text); }
  .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
  .cal-grid .cal-dow { font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 0; }
  .cal-grid .cal-day {
    font-size: 12px; color: var(--text); padding: 6px 0; border-radius: 8px;
    cursor: pointer; transition: background 0.12s;
  }
  .cal-grid .cal-day:hover { background: var(--border); }
  .cal-grid .cal-day.today { border: 1px solid var(--accent); }
  .cal-grid .cal-day.selected { background: var(--accent); color: #fff; font-weight: 600; }
  .cal-grid .cal-day.other { color: var(--muted); opacity: 0.4; }
  .csel-display {
    background-color: var(--surface2); border: none; border-radius: 12px;
    padding: 10px 32px 10px 14px; font-size: 13px; color: var(--text);
    cursor: pointer; width: 100%; text-align: left; outline: none;
    font-family: var(--font); position: relative; user-select: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 13px;
    transition: background-color 0.12s;
  }
  .csel-display:hover { background-color: var(--bg3); }
  .csel-menu {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    z-index: 9999; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px;
    max-height: 220px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.4);
    padding: 4px; animation: dropSlide 0.14s ease;
  }
  .csel-menu.open { display: block; }
  .csel-opt {
    padding: 9px 14px; border-radius: 8px; font-size: 13px; color: var(--text);
    cursor: pointer; transition: background 0.15s; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; margin: 3px;
  }
  .csel-opt:hover { background: var(--border); }
  .csel-opt.active { background: var(--border); font-weight: 600; }

  /* ── Select global aprimorado ── */
  select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 13px;
    padding-right: 30px !important;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }
  select:hover { border-color: var(--accent); }
  select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79,110,247,0.18);
    outline: none;
  }

  /* ── Custom dropdowns (país, idioma) animação ── */
  #cr-countries-dropdown, #cr-locales-dropdown {
    transform-origin: top center;
    animation: dropSlide 0.14s ease;
  }
  @keyframes dropSlide {
    from { opacity: 0; transform: translateY(-6px) scaleY(0.95); }
    to   { opacity: 1; transform: translateY(0)   scaleY(1); }
  }
  @keyframes taskPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
  }

  /* ── Panel grip (drag handle) ── */
  .panel-grip {
    cursor: grab; opacity: .25; transition: opacity .15s; display: flex;
    align-items: center; padding: 4px; border-radius: 4px;
  }
  .panel-grip:hover { opacity: .6; }
  .dash-panel { transition: opacity .2s, box-shadow .2s; }
  .dash-panel.dragging { opacity: .4; box-shadow: 0 0 0 2px var(--accent); }
  .dash-panel.drag-over { box-shadow: 0 -3px 0 0 var(--accent); }

  /* ── Page Picker (com foto) ── */
  .page-picker { position: relative; }
  .page-picker-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    min-height: 38px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
  }
  .page-picker-trigger:hover { border-color: var(--accent); }
  .page-picker-trigger.open {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79,110,247,0.18);
  }
  .page-picker-trigger img {
    width: 22px; height: 22px;
    border-radius: 50%; object-fit: cover; flex-shrink: 0;
  }
  .page-picker-trigger .pp-chevron {
    margin-left: auto; flex-shrink: 0;
    transition: transform 0.2s ease;
  }
  .page-picker-trigger.open .pp-chevron { transform: rotate(180deg); }
  .page-picker-dropdown {
    position: absolute; top: calc(100% + 5px);
    left: 0; right: 0; z-index: 1000;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-height: 260px; overflow-y: auto;
    box-shadow: 0 8px 28px rgba(0,0,0,.45);
    transform-origin: top center;
    animation: dropSlide 0.15s ease;
  }
  .page-picker-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; cursor: pointer;
    font-size: 13px; color: var(--text);
    transition: background 0.1s ease;
  }
  .page-picker-item:first-child { border-radius: 12px 12px 0 0; }
  .page-picker-item:last-child  { border-radius: 0 0 12px 12px; }
  .page-picker-item:hover { background: rgba(79,110,247,0.12); }
  .page-picker-item img {
    width: 30px; height: 30px;
    border-radius: 50%; object-fit: cover; flex-shrink: 0;
  }
  .page-picker-item .pp-avatar {
    width: 30px; height: 30px;
    border-radius: 50%; background: var(--bg3);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 13px; color: var(--muted);
  }

  /* ── Monitor Cards ─────────────────────────────── */
  .mon-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s;
  }
  .mon-card-active { border-color: rgba(34,197,94,.35); }
  .mon-card-scheduled { border-color: rgba(245,158,11,.35); }
  .mon-card-scheduled .mon-status-dot {
    animation: monPulseYellow 2s ease-in-out infinite;
  }
  @keyframes monPulseYellow {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(245,158,11,.4); }
    50% { opacity: .7; box-shadow: 0 0 0 5px rgba(245,158,11,0); }
  }
  .mon-card-ended { opacity: 0.7; }
  .mon-card-error { opacity: 1; border-color: rgba(239,68,68,.35); }
  .mon-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .mon-card-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .mon-card-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mon-status-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: monPulse 2s ease-in-out infinite;
  }
  .mon-card-ended .mon-status-dot { animation: none; }
  @keyframes monPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
    50% { opacity: .7; box-shadow: 0 0 0 5px rgba(34,197,94,0); }
  }
  .mon-status-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .mon-level-badge {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(79,110,247,.12);
    color: var(--accent);
    font-weight: 600;
  }
  .mon-btn-action {
    padding: 5px 14px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
  }
  .mon-btn-delete {
    padding: 5px 14px;
    font-size: 12px;
    background: var(--bg);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,.3);
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
  }
  .mon-btn-delete:hover { background: rgba(239,68,68,.1); }
  .mon-card-body { padding: 18px; }

  .mon-stats-row {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
    min-height: 68px;
  }
  .mon-stat {
    background: var(--bg);
    border-radius: 10px;
    padding: 12px 14px;
    text-align: center;
  }
  .mon-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
  }
  .mon-stat-label {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .mon-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
  }
  .mon-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
  }
  .mon-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 3px;
    transition: width 0.5s ease;
  }
  .mon-progress-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    min-width: 36px;
    text-align: right;
  }

  .mon-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
  }
  .mon-info-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
    background: var(--bg);
    border-radius: 8px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    min-width: 0;
    overflow: hidden;
    text-align: center;
  }
  .mon-info-icon { font-size: 13px; flex-shrink: 0; }
  .mon-info-text { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

  .mon-section { margin-bottom: 7px; }
  .mon-section:last-child { margin-bottom: 0; }
  .mon-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    margin-bottom: 8px;
  }

  .mon-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .mon-chip {
    display: inline-block;
    padding: 5px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11.5px;
    color: var(--text);
    font-family: var(--mono);
    line-height: 1.3;
    word-break: break-all;
  }
  .mon-chip-extra {
    background: rgba(79,110,247,.1);
    border-color: rgba(79,110,247,.25);
    color: var(--accent);
    font-weight: 600;
  }

  .mon-logs-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 0;
    user-select: none;
  }
  .mon-logs-header:hover .mon-section-title { color: var(--text); }
  .mon-log-preview {
    flex: 1;
    font-size: 11px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--mono);
  }
  .mon-logs-chevron {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--muted);
    transition: transform 0.2s ease;
  }
  .mon-logs-chevron.open { transform: rotate(180deg); }
  .mon-logs-body {
    background: var(--bg);
    border-radius: 8px;
    padding: 12px 14px;
    min-height: calc(11.5px * 1.7 * 5 + 24px);
    max-height: calc(11.5px * 1.7 * 5 + 24px);
    overflow-y: scroll;
    overscroll-behavior: contain;
    font-size: 11.5px;
    font-family: var(--mono);
    color: var(--muted);
    line-height: 1.7;
    margin-top: 6px;
  }
  .mon-log-line {
    padding: 1px 0;
    border-bottom: 1px solid rgba(255,255,255,.03);
  }
  .mon-log-line:last-child { border-bottom: none; }

  /* Logs expand toggle */
  .mon-panels-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 1 / -1;
    min-height: 1004px;
  }
  .mon-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,.08);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .mon-logs-section { position: relative; }
  .mon-logs-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 3px 0 1px;
    opacity: 0;
    transition: opacity 0.2s;
    color: var(--muted);
  }
  .mon-logs-section:hover .mon-logs-expand { opacity: 1; }
  .mon-logs-expand:hover { color: var(--text); }
  .mon-logs-expand svg { transition: transform 0.2s; }
  .mon-logs-expand.open svg { transform: rotate(180deg); }

  /* Hover popup for budget campaign names */
  .bud-hover-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 220px;
    max-width: 360px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    margin-top: 6px;
  }
  .bud-stat-hover:hover .bud-hover-popup { display: block; }
  .bud-hover-popup > div:last-child { border-bottom: none; }

  /* monitor restored alert */
  /* Toast notifications */
  .toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
  }
  .toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid rgba(79,110,247,.25);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    font-size: 13px;
    color: var(--text);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 9.7s forwards;
    max-width: 380px;
  }
  .toast .toast-icon { font-size: 16px; flex-shrink: 0; }
  .toast .toast-close {
    background: none; border: none; color: var(--muted); cursor: pointer;
    font-size: 16px; padding: 2px 6px; border-radius: 4px; line-height: 1; flex-shrink: 0;
  }
  .toast .toast-close:hover { background: rgba(255,255,255,.06); color: var(--text); }
  @keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
  @keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(40px); } }

  .mon-restored-alert {
    display: none;
    font-size: 13px;
    color: var(--accent);
  }
  .mon-restored-alert button {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
  }
  .mon-restored-alert button:hover { background: rgba(255,255,255,.06); color: var(--text); }

  /* ── Monitor Grid Layout ─────────────────────── */
  .mon-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .mon-grid:has(> :nth-child(2)) {
    grid-template-columns: 1fr 1fr;
  }
  .mon-grid > :only-child {
    grid-column: 1 / -1;
  }
  /* Odd last child spans full width when >1 items */
  .mon-grid:has(> :nth-child(2)) > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  /* ── Monitor Campaign List ────────────────────── */
  .mon-camp-search {
    width: 100%;
    padding: 9px 12px 9px 38px !important;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
  }
  .mon-camp-search:focus { border-color: var(--accent); }
  .mon-camp-search-wrap {
    position: relative;
    margin-bottom: 8px;
  }
  .mon-camp-search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--muted);
  }
  .mon-camp-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
  }
  .mon-camp-toolbar button {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    padding: 3px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .mon-camp-toolbar button:hover { color: var(--text); border-color: var(--accent); }
  .mon-camp-toolbar .mon-camp-count { margin-left: auto; color: var(--muted); }
  .mon-camp-items-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .mon-camp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.1s;
    user-select: none;
  }
  .mon-camp-item:hover { border-color: rgba(79,110,247,.35); background: var(--surface2); }
  .mon-camp-item.checked { border-color: var(--accent); background: rgba(79,110,247,.06); }
  .mon-camp-cb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s;
  }
  .mon-camp-cb:focus { outline: none; border-color: var(--border); }
  .mon-camp-cb:checked:focus { border-color: var(--accent); }
  .mon-camp-cb:checked {
    background: var(--accent);
    border-color: var(--accent);
  }
  .mon-camp-cb:checked::after {
    content: '';
    position: absolute;
    top: 3px; left: 6px;
    width: 5px; height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  .mon-camp-name {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mon-camp-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
  }
  .mon-camp-status.active { background: rgba(34,197,94,.12); color: #22c55e; }
  .mon-camp-status.paused { background: rgba(255,255,255,.06); color: var(--muted); }

  /* ── Two-Panel Layout (form | active cards) ──── */
  .dash-two-panel {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
  }
  .dash-panel-form { min-width: 0; }
  .dash-panel-form > .card { margin-bottom: 0; height: 1080px; }
  .dash-panel-active { min-width: 0; }
  .dash-panel-active > .card { margin-bottom: 0; height: 1080px; }
  .dash-panel-active-scroll {
    max-height: 1004px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 2px;
    align-content: start;
  }
  .dash-panel-active-scroll:has(> .mon-panels-loading:only-child) {
    align-content: center;
  }
  .dash-panel-active-scroll:has(> :nth-child(2)) {
    grid-template-columns: 1fr 1fr;
  }
  .dash-panel-active-scroll:has(> :nth-child(3)) {
    grid-template-columns: repeat(6, 1fr);
  }
  .dash-panel-active-scroll:has(> :nth-child(3)) > .mon-card {
    grid-column: span 2;
  }
  /* Sobrou 1 na última linha: ocupa tudo */
  .dash-panel-active-scroll:has(> :nth-child(3)) > :last-child:nth-child(3n+1) {
    grid-column: 1 / -1;
  }
  /* Sobraram 2 na última linha: cada um ocupa metade (3 de 6 colunas) */
  .dash-panel-active-scroll:has(> :nth-child(3)) > :nth-last-child(2):nth-child(3n+1),
  .dash-panel-active-scroll:has(> :nth-child(3)) > :nth-last-child(1):nth-child(3n+2) {
    grid-column: span 3;
  }
  .mon-camps-fixed {
    height: 88px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .mon-camps-fixed > .mon-section-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mon-chips-section {
    height: 54px;
    overflow: hidden;
    transition: height 0.3s ease;
  }
  .mon-chips-section .mon-chips-wrap {
    max-height: 30px;
    overflow: hidden;
  }
  .mon-chips-section .mon-chips-toggle {
    margin-top: 1px;
  }
  .mon-chips-section.open {
    height: auto;
  }
  .mon-camps-fixed:has(.mon-chips-section.open) {
    height: auto;
  }
  .mon-chips-section.open .mon-chips-wrap {
    max-height: none;
  }
  .mon-chips-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    font-size: 11px;
    color: var(--muted);
    padding: 2px 0;
    user-select: none;
    transition: color 0.15s;
  }
  .mon-chips-toggle:hover { color: var(--text); }
  .mon-chips-toggle svg { transition: transform 0.2s; }
  .mon-chips-section.open .mon-chips-toggle svg,
  .mon-chips-toggle.open svg { transform: rotate(180deg); }

  @media (max-width: 1100px) {
    .dash-two-panel { grid-template-columns: 1fr; }
    .dash-panel-form > .card,
    .dash-panel-active > .card { height: auto; min-height: 400px; }
    .dash-panel-active-scroll { max-height: 600px; }
    .dash-panel-active-scroll:has(> :nth-child(2)) { grid-template-columns: 1fr 1fr; }
  }

  @media (max-width: 900px) {
    .mon-grid, .mon-grid:has(> :nth-child(2)) { grid-template-columns: 1fr; }
    .mon-grid > :last-child:nth-child(odd) { grid-column: auto; }
    .dash-panel-active-scroll,
    .dash-panel-active-scroll:has(> :nth-child(2)),
    .dash-panel-active-scroll:has(> :nth-child(3)) { grid-template-columns: 1fr; }
    .dash-panel-active-scroll:has(> :nth-child(3)) > .mon-card,
    .dash-panel-active-scroll:has(> :nth-child(3)) > :last-child:nth-child(3n+1),
    .dash-panel-active-scroll:has(> :nth-child(3)) > :nth-last-child(2):nth-child(3n+1),
    .dash-panel-active-scroll:has(> :nth-child(3)) > :nth-last-child(1):nth-child(3n+2) { grid-column: auto; }
  }

  @media (max-width: 768px) {
    .dash-panel-form > .card,
    .dash-panel-active > .card { height: auto !important; min-height: auto; }
    .dash-panel-active-scroll { max-height: none; }
    .mon-card-header { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
    .mon-card-body { padding: 14px; }
    .mon-info-grid { grid-template-columns: 1fr; }
    .mon-camps-fixed { height: auto; }
    #cm-campaign-list,
    #dup-campaign-list,
    #bud-campaign-list { height: auto !important; max-height: 350px; }
    .nav-submenu { padding-left: 0; }
  }

  @media (max-width: 640px) {
    .mon-stats-row { grid-template-columns: repeat(2, 1fr); }
    .mon-stat-value { font-size: 15px; }
    .mon-status-label { font-size: 11px; }
    .mon-level-badge { font-size: 10px; padding: 2px 8px; }
  }

  /* ── DEMOGRÁFICOS ────────────────────────── */
  /* ── Produção Board (table view) ── */
  .prod-group { margin-bottom:28px; background:var(--surface); border:1px solid var(--border); border-radius:14px; overflow:hidden; }
  .prod-group-header { display:flex; align-items:center; gap:12px; padding:14px 20px; cursor:pointer; user-select:none; transition:background .12s; }
  .prod-group-header:hover { background:var(--surface2); }
  .prod-group-header .prod-chev { font-size:10px; color:var(--muted); transition:transform .2s; }
  .prod-group-header.collapsed .prod-chev { transform:rotate(-90deg); }
  .prod-group-title { font-size:20px; font-weight:800; text-transform:uppercase; letter-spacing:0.03em; }
  .prod-group-count { font-size:15px; color:var(--muted); font-family:var(--mono); font-weight:700; }
  .prod-table { width:100%; border-collapse:collapse; margin-bottom:2px; }
  .prod-table th { font-size:17px; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; color:var(--text); padding:12px 16px; text-align:center; border-bottom:2px solid rgba(255,255,255,0.18); border-right:1px solid rgba(255,255,255,0.18); background:var(--surface2); }
  .prod-table th:last-child { border-right:none; }
  .prod-table td { padding:12px 16px; border-bottom:1px solid rgba(255,255,255,0.15); font-size:17px; vertical-align:middle; border-right:1px solid rgba(255,255,255,0.12); }
  .prod-table td:last-child { border-right:none; }
  body.light-mode .prod-table th { border-bottom-color:rgba(0,0,0,0.18); border-right-color:rgba(0,0,0,0.18); }
  body.light-mode .prod-table td { border-bottom-color:rgba(0,0,0,0.15); border-right-color:rgba(0,0,0,0.12); }
  .prod-table tr:hover td { background:var(--surface2); }
  .prod-table tr { transition:background .1s; }
  .prod-table td.prod-cell-status,
  .prod-table td.prod-cell-prio { padding:0 !important; text-align:center; cursor:pointer; position:relative; }
  .prod-cell-fill { display:flex; align-items:center; justify-content:center; width:100%; height:100%; min-height:48px; font-size:17px; font-weight:400; color:#fff; letter-spacing:0.02em; transition:filter .12s; }
  .prod-cell-fill:hover { filter:brightness(1.15); }
  .prod-assignee-tag { display:inline-block; padding:6px 14px; border-radius:20px; font-size:17px; font-weight:400; color:#111; letter-spacing:0.02em; }
  .prod-add-row { padding:10px 16px; font-size:15px; color:var(--muted); cursor:pointer; transition:color .15s; }
  .prod-add-row:hover { color:var(--accent); }
  /* Team mode: overrides removidos em 2026-04-25.
     Era legacy de quando admin usava light-mode e team-mode forçava sidebar escura.
     Como light-mode foi desabilitado globalmente (ver dark_theme_only.md),
     non-admin agora compartilha o tema premium dark com admin — sem drift de cores hardcoded.
     A classe `body.team-mode` continua sendo aplicada via core.js mas sem efeito de styling. */

  /* Sub-abas nicho — 2026-04-24: alinhado 100% com .rt-pin-tab (mesmo padding/radius/font). */
  .prod-niche-tabs { display:flex; gap:6px; margin-bottom:28px; align-items:flex-end; flex-wrap:wrap; }
  .prod-niche-tab {
    /* Base .card + overrides de shape de aba (maior que .rt-pin-tab por ser entry point) */
    padding:14px 28px 12px !important;
    margin-bottom:0 !important;
    border-radius:10px 10px 0 0 !important;
    cursor:pointer; user-select:none;
    font-size:16px; font-weight:700;
    color:var(--muted);
    display:inline-flex; align-items:center; gap:10px;
    opacity:0.7; transition:opacity .15s, color .15s, border-bottom-color .15s;
    white-space:nowrap;
    letter-spacing:0.02em;
  }
  .prod-niche-tab:hover { opacity:1; color:var(--text); }
  .prod-niche-tab.active { opacity:1; color:var(--text); font-weight:800; border-bottom:2px solid var(--accent) !important; }
  /* Niche tab colors — apenas borda-top colorida */
  .prod-niche-tab[data-niche="resumo"] { border-top:3px solid var(--accent) !important; }
  .prod-niche-tab[data-niche="resumo"]:not(.active) { color:var(--accent); }
  .prod-niche-tab[data-niche="resumo"].active { color:var(--accent); border-bottom-color:var(--accent) !important; }

  /* Cores fixas das abas de Métricas de Copy — alinhado com padrão novo:
     border-top colorido + texto na cor do nicho + border-bottom da mesma cor quando ativo. */
  #cm-niche-tabs .prod-niche-tab[data-niche="todos"] { border-top:3px solid #6366f1 !important; }
  #cm-niche-tabs .prod-niche-tab[data-niche="todos"]:not(.active) { color:#6366f1; }
  #cm-niche-tabs .prod-niche-tab[data-niche="todos"].active { color:#6366f1; border-bottom-color:#6366f1 !important; }
  #cm-niche-tabs .prod-niche-tab[data-niche="memoria"] { border-top:3px solid #f59e0b !important; }
  #cm-niche-tabs .prod-niche-tab[data-niche="memoria"]:not(.active) { color:#f59e0b; }
  #cm-niche-tabs .prod-niche-tab[data-niche="memoria"].active { color:#f59e0b; border-bottom-color:#f59e0b !important; }
  #cm-niche-tabs .prod-niche-tab[data-niche="neuropatia"] { border-top:3px solid #22c55e !important; }
  #cm-niche-tabs .prod-niche-tab[data-niche="neuropatia"]:not(.active) { color:#22c55e; }
  #cm-niche-tabs .prod-niche-tab[data-niche="neuropatia"].active { color:#22c55e; border-bottom-color:#22c55e !important; }
  #cm-niche-tabs .prod-niche-tab[data-niche="emagrecimento"] { border-top:3px solid #ec4899 !important; }
  #cm-niche-tabs .prod-niche-tab[data-niche="emagrecimento"]:not(.active) { color:#ec4899; }
  #cm-niche-tabs .prod-niche-tab[data-niche="emagrecimento"].active { color:#ec4899; border-bottom-color:#ec4899 !important; }
  .prod-niche-add-btn { padding:14px 20px; font-size:20px; font-weight:900; color:var(--muted); cursor:pointer; background:var(--surface2); border:2px solid var(--border); border-bottom:none; border-radius:12px 12px 0 0; position:relative; top:3px; transition:all .15s; user-select:none; margin-right:6px; line-height:1; }
  .prod-niche-add-btn:hover { color:var(--accent); background:var(--surface); }
  .prod-niche-tab .niche-count { font-size:13px; font-weight:800; background:rgba(255,255,255,0.08); color:var(--muted); border-radius:14px; padding:4px 12px; margin-left:8px; }
  .prod-niche-tab.active .niche-count { background:rgba(255,255,255,0.3); color:#fff; }
  /* Resumo — migrado pra CSS vars */
  .prod-resumo { display:grid; grid-template-columns:repeat(auto-fit, minmax(340px,1fr)); gap:20px; margin-bottom:28px; }
  /* Resumo cards — usam .card canonical (Premium). Só aplicamos overrides de layout/shape. */
  .prod-resumo-card { padding:28px !important; margin-bottom:0 !important; }
  .prod-resumo-card h3 { font-size:18px; font-weight:800; text-transform:uppercase; letter-spacing:0.03em; margin-bottom:18px; color:var(--text); display:flex; align-items:center; gap:10px; }
  .prod-resumo-card h3 .dot { width:14px; height:14px; border-radius:50%; }
  .prod-resumo-card h3 .niche-total { font-size:28px; font-weight:900; margin-left:auto; }
  .prod-resumo-row { display:flex; justify-content:space-between; align-items:center; padding:10px 0; font-size:15px; color:var(--text); border-bottom:1px solid var(--border); }
  .prod-resumo-row:last-child { border-bottom:none; }
  .prod-resumo-row .count { font-weight:900; font-size:20px; color:var(--text); min-width:36px; text-align:right; }
  .prod-resumo-row .group-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
  .prod-resumo-hero { display:flex; gap:20px; margin-bottom:28px; }
  .prod-resumo-hero-card { flex:1; padding:28px !important; margin-bottom:0 !important; text-align:center; }
  .prod-resumo-hero-card .hero-number { font-size:48px; font-weight:900; line-height:1; margin-bottom:6px; }
  .prod-resumo-hero-card .hero-label { font-size:14px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:0.04em; }
  /* Botão Atualizar usa .btn.btn-ghost canonical — wrapper só cuida do layout */
  .prod-resumo-refresh { display:flex; justify-content:flex-end; margin-bottom:20px; }
  .prod-resumo-refresh button.loading { opacity:0.6; pointer-events:none; }
  .prod-resumo-refresh button svg { transition:transform .3s; }
  .prod-resumo-refresh button.loading svg { animation: spin-refresh .8s linear infinite; }
  @keyframes spin-refresh { from { transform:rotate(0deg); } to { transform:rotate(360deg); } }

  /* Tarefas do Dia — modal flutuante */
  .td-modal {
    position:fixed; z-index:9999; width:380px; max-height:70vh;
    background:var(--surface); border:1px solid var(--border); border-radius:16px;
    box-shadow:0 12px 48px rgba(0,0,0,0.4); display:none; flex-direction:column;
    overflow:hidden; resize:both;
  }
  .td-modal.open { display:flex; }
  .td-header {
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 18px; background:var(--surface2); cursor:grab;
    border-bottom:1px solid var(--border); user-select:none;
  }
  .td-header:active { cursor:grabbing; }
  .td-header h3 { font-size:15px; font-weight:800; display:flex; align-items:center; gap:8px; }
  .td-header .td-count { font-size:12px; font-weight:700; background:var(--accent); color:#fff; border-radius:10px; padding:2px 8px; }
  .td-close { cursor:pointer; color:var(--muted); font-size:20px; line-height:1; padding:4px; }
  .td-close:hover { color:var(--text); }
  .td-body { flex:1; overflow-y:auto; padding:12px; }
  .td-add { display:flex; gap:8px; padding:12px; border-top:1px solid var(--border); }
  .td-add input { flex:1; padding:8px 12px; background:var(--bg); border:1px solid var(--border); border-radius:8px; color:var(--text); font-size:13px; }
  .td-add input:focus { border-color:var(--accent); outline:none; }
  .td-add button { padding:8px 14px; border-radius:8px; border:none; background:var(--accent); color:#fff; font-size:13px; font-weight:700; cursor:pointer; }
  .td-item {
    display:flex; align-items:flex-start; gap:10px; padding:10px 8px;
    border-radius:10px; transition:all .15s; border-bottom:1px solid var(--border);
  }
  .td-item:last-child { border-bottom:none; }
  .td-item:hover { background:var(--surface2); }
  .td-item.done { opacity:0.5; }
  .td-item.done .td-text { text-decoration:line-through; color:var(--muted); }
  .td-check { width:20px; height:20px; border-radius:6px; border:2px solid var(--border); cursor:pointer; flex-shrink:0; display:flex; align-items:center; justify-content:center; margin-top:2px; transition:all .15s; }
  .td-check:hover { border-color:var(--accent); }
  .td-check.checked { background:var(--accent); border-color:var(--accent); }
  .td-text { flex:1; font-size:14px; font-weight:500; line-height:1.4; }
  .td-prio { font-size:10px; font-weight:700; padding:2px 8px; border-radius:6px; cursor:pointer; flex-shrink:0; text-transform:uppercase; letter-spacing:.04em; }
  .td-prio[data-p="alta"] { background:rgba(239,68,68,.15); color:var(--red); }
  .td-prio[data-p="media"] { background:rgba(245,158,11,.15); color:var(--yellow); }
  .td-prio[data-p="baixa"] { background:rgba(99,102,241,.15); color:var(--accent); }
  .td-delete { cursor:pointer; color:var(--muted); font-size:14px; opacity:0; transition:opacity .15s; flex-shrink:0; }
  .td-item:hover .td-delete { opacity:1; }
  .td-empty { text-align:center; padding:32px 16px; color:var(--muted); font-size:13px; }

  /* User cards */
  .usr-input { font-size:13px; padding:9px 14px; border-radius:10px; background:var(--bg); border:1px solid var(--border); color:var(--text); width:100%; }
  .usr-input:focus { border-color:var(--accent); outline:none; }
  .usr-card { background:var(--surface2); border:1px solid var(--border); border-radius:12px; margin-bottom:10px; overflow:hidden; transition:all .15s; }
  .usr-card-header { display:flex; align-items:center; gap:14px; padding:16px 20px; cursor:pointer; }
  .usr-card-header:hover { background:rgba(255,255,255,0.03); }
  .usr-card-avatar { width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:16px; font-weight:800; color:#fff; flex-shrink:0; }
  .usr-card-info { flex:1; }
  .usr-card-name { font-size:15px; font-weight:700; }
  .usr-card-meta { font-size:12px; color:var(--muted); margin-top:2px; }
  .usr-card-badge { font-size:10px; font-weight:700; padding:3px 10px; border-radius:8px; text-transform:uppercase; letter-spacing:.04em; }
  .usr-card-body { display:none; padding:0 20px 20px; }
  .usr-card.open .usr-card-body { display:block; }
  .usr-card-field { margin-bottom:10px; }
  .usr-card-field label { display:block; font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; margin-bottom:4px; }

  /* Seleção em massa */
  .prod-table tr.prod-selected td { background:rgba(99,102,241,0.12) !important; }
  .prod-table tr.prod-selected td:first-child::before { content:'✓ '; color:var(--accent); font-weight:700; }
  .prod-bulk-bar {
    position:fixed; bottom:0; left:0; right:0; z-index:9980;
    background:var(--surface); border-top:2px solid var(--accent);
    box-shadow:0 -4px 24px rgba(0,0,0,0.3); padding:14px 24px;
    display:none; align-items:center; gap:16px; justify-content:space-between;
  }
  .prod-bulk-bar.open { display:flex; }
  .prod-bulk-bar .bulk-count { font-size:15px; font-weight:700; color:var(--accent); }
  .prod-bulk-bar .bulk-actions { display:flex; gap:8px; flex-wrap:wrap; }
  .prod-bulk-bar .bulk-btn { padding:8px 16px; border-radius:8px; border:1px solid var(--border); background:var(--surface2); color:var(--text); font-size:13px; font-weight:600; cursor:pointer; transition:all .15s; }
  .prod-bulk-bar .bulk-btn:hover { background:var(--accent); color:#fff; border-color:var(--accent); }
  .prod-bulk-bar .bulk-btn.danger { color:var(--red); }
  .prod-bulk-bar .bulk-btn.danger:hover { background:var(--red); color:#fff; border-color:var(--red); }
  /* 2026-04-24: removida override light-mode (dead code) */

  /* ── Produção Responsivo ── */
  @media (max-width: 768px) {
    #page-producao { margin:-20px -16px; padding:20px 16px; }
    #page-producao .page-header { flex-direction:column; align-items:flex-start; gap:12px; }
    #page-producao .page-title { font-size:20px; }
    .prod-niche-tabs { overflow-x:auto; -webkit-overflow-scrolling:touch; }
    .prod-niche-tab { padding:10px 18px; font-size:13px; white-space:nowrap; flex-shrink:0; }
    .prod-group-title { font-size:14px; }
    .prod-group-count { font-size:12px; }
    .prod-group-header { padding:10px 14px; gap:8px; }
    .prod-table { display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }
    .prod-table th { font-size:12px; padding:8px 10px; white-space:nowrap; }
    .prod-table td { font-size:13px; padding:8px 10px; white-space:nowrap; }
    .prod-cell-fill { font-size:12px; min-height:36px; }
    .prod-assignee-tag { font-size:12px; padding:4px 10px; }
    .prod-add-row { font-size:13px; padding:8px 14px; }
    .prod-panel { width:100%; max-width:100%; }
    .prod-resumo { grid-template-columns:1fr; }
    .prod-resumo-hero { flex-direction:column; gap:12px; }
    .prod-resumo-hero-card { padding:18px; }
    .prod-resumo-hero-card .hero-number { font-size:36px; }
    .prod-resumo-card { padding:18px; }
    .prod-resumo-refresh button { width:100%; justify-content:center; }
  }

  .btn-ghost.cm-active { background:var(--accent); color:#fff; border-color:var(--accent); }

  /* 2026-04-24: removido background:#fff hardcoded e color:#111 — quebrava dark mode */
  #page-producao { background:transparent; min-height:100vh; margin:-40px -50px; padding:40px 50px; }
  #page-producao .page-title { color:var(--text); }
  #page-producao .page-sub { color:var(--muted); }
  /* Side Panel */
  .prod-panel-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9990; opacity:0; pointer-events:none; transition:opacity .25s; }
  .prod-panel-overlay.open { opacity:1; pointer-events:all; }
  .prod-panel { position:fixed; top:0; right:0; bottom:0; width:420px; max-width:90vw; z-index:9991; background:var(--surface); border-left:1px solid var(--border); box-shadow:-8px 0 32px rgba(0,0,0,0.3); transform:translateX(100%); transition:transform .25s ease; display:flex; flex-direction:column; }
  .prod-panel.open { transform:translateX(0); }
  .prod-panel-header { display:flex; align-items:center; justify-content:space-between; padding:20px 24px; border-bottom:1px solid var(--border); }
  .prod-panel-body { flex:1; overflow-y:auto; padding:20px 24px; }
  .prod-panel-footer { padding:16px 24px; border-top:1px solid var(--border); display:flex; gap:8px; justify-content:flex-end; }
  .prod-field { margin-bottom:16px; }
  .prod-field > label { display:block; font-size:12px; font-weight:600; color:var(--muted); margin-bottom:6px; text-transform:uppercase; letter-spacing:.04em; }
  .prod-panel-input { width:100%; padding:11px 15px; background:var(--surface2); border:1px solid var(--border); border-radius:10px; font-size:14px; font-weight:600; color:var(--text); font-family:var(--font); }
  .prod-panel-input:focus { border-color:rgba(56,189,248,0.35); outline:none; }
  .prod-link { font-size:11px; color:var(--accent); text-decoration:none; }
  .prod-link:hover { text-decoration:underline; }
  .prod-comment-badge { font-size:15px; font-weight:700; color:var(--accent); }
  .prod-comments-list { display:flex; flex-direction:column; gap:12px; }
  .prod-comment-bubble { padding:10px 14px; border-radius:10px; background:var(--surface2); border:1px solid var(--border); }
  .prod-comment-author { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.03em; margin-bottom:4px; }
  .prod-comment-text { font-size:14px; color:var(--text); white-space:pre-wrap; word-break:break-word; }
  .prod-comment-time { font-size:10px; color:var(--muted); margin-top:4px; font-family:var(--mono); }
  /* 2026-04-24: removidas as overrides team-mode que forçavam styling light nos comentários
     (light-mode desabilitado globalmente). Comentários herdam .prod-comment-* base (CSS vars). */
  .prod-btn-link { font-size:15px; font-weight:700; padding:6px 14px; border-radius:6px; display:inline-block; text-decoration:none; transition:all .15s; }
  .prod-btn-link.active { background:var(--accent); color:var(--bg); cursor:pointer; }
  .prod-btn-link.active:hover { background:var(--accent2); }
  .prod-btn-link.disabled { background:var(--surface2); color:var(--muted); cursor:not-allowed; opacity:0.5; border:1px solid var(--border); }
  /* Status dropdown inline */
  .prod-status-drop { position:relative; display:inline-block; }
  .prod-status-menu { position:fixed; z-index:9999; background:var(--surface); border:1px solid var(--border); border-radius:10px; box-shadow:0 12px 36px rgba(0,0,0,0.4); overflow:hidden; min-width:180px; display:none; }
  .prod-status-menu.open { display:block; }
  .prod-status-opt { padding:8px 14px; font-size:12px; font-weight:600; cursor:pointer; display:flex; align-items:center; gap:8px; transition:background .1s; }
  .prod-status-opt:hover { background:var(--surface2); }

  .demo-filters { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:24px; }
  .demo-filters select, .demo-filters input { font-size:13px; padding:6px 12px; border-radius:8px; background:var(--surface2); border:1px solid var(--border); color:var(--text); }
  .demo-filters .btn { font-size:13px; padding:6px 16px; }
  .demo-period-btns { display:flex; gap:4px; }
  .demo-period-btns button { font-size:12px; padding:5px 12px; border-radius:8px; background:var(--surface2); border:1px solid var(--border); color:var(--muted); cursor:pointer; transition:all .2s; }
  .demo-period-btns button.active { background:var(--accent); color:#fff; border-color:var(--accent); }
  .demo-updated { font-size:12px; color:var(--muted); margin-left:auto; }
  .demo-grid-2 { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; margin-bottom:16px; }
  .demo-section { margin-bottom:24px; }
  .demo-section-title { font-size:13px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.07em; margin-bottom:14px; }
  /* Donut */
  .demo-donut-wrap { display:flex; align-items:center; gap:24px; padding:20px; }
  .demo-donut-svg { flex-shrink:0; }
  .demo-donut-legend { display:flex; flex-direction:column; gap:8px; }
  .demo-legend-item { display:flex; align-items:center; gap:8px; font-size:13px; }
  .demo-legend-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
  .demo-legend-label { color:var(--text); font-weight:600; }
  .demo-legend-val { color:var(--muted); font-size:12px; }
  /* Bars */
  .demo-bar-row { display:flex; align-items:center; gap:12px; padding:8px 0; border-bottom:1px solid var(--border-cell); }
  .demo-bar-label { width:100px; font-size:13px; color:var(--text); font-weight:600; flex-shrink:0; text-align:right; }
  .demo-bar-track { flex:1; height:24px; background:var(--surface2); border-radius:6px; overflow:hidden; position:relative; }
  .demo-bar-fill { height:100%; border-radius:6px; transition:width .4s ease; min-width:2px; }
  .demo-bar-stats { display:flex; gap:12px; font-size:12px; color:var(--muted); flex-shrink:0; min-width:200px; }
  .demo-bar-stats span { white-space:nowrap; }
  .demo-bar-stats .roas-good { color:var(--green); font-weight:700; }
  .demo-bar-stats .roas-mid { color:var(--yellow); font-weight:700; }
  .demo-bar-stats .roas-bad { color:var(--red); font-weight:700; }
  /* Region grid */
  .demo-region-row { display:flex; align-items:center; gap:12px; padding:10px 16px; border-bottom:1px solid var(--border-cell); }
  .demo-region-row:last-child { border-bottom:none; }
  .demo-region-rank { font-size:14px; font-weight:800; color:var(--accent); width:30px; text-align:center; }
  .demo-region-name { flex:1; font-size:14px; font-weight:600; color:var(--text); }
  .demo-region-stat { font-size:13px; color:var(--muted); min-width:90px; text-align:right; }
  .demo-loading { text-align:center; padding:40px; color:var(--muted); font-size:14px; }
  @media(max-width:768px) {
    .demo-grid-2 { grid-template-columns:1fr; }
    .demo-bar-row { flex-wrap:wrap; }
    .demo-bar-label { width:80px; font-size:12px; }
    .demo-bar-stats { min-width:auto; flex-wrap:wrap; }
  }

  /* ── ORÁCULO ──────────────────────────────────── */
  /* Alertas históricos */
  .ora-alerts { display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
  .ora-alert { display:flex; align-items:flex-start; gap:10px; padding:12px 16px; border-radius:10px; font-size:13px; line-height:1.5; background:var(--surface); border:1px solid var(--border); }
  .ora-alert-icon { flex-shrink:0; width:20px; height:20px; display:flex; align-items:center; justify-content:center; font-size:14px; margin-top:1px; }
  .ora-alert-icon.ic-chart { color:#60a5fa; }
  .ora-alert-icon.ic-warning { color:#BA7517; }
  .ora-alert-icon.ic-alert { color:#E24B4A; }
  .ora-alert-icon.ic-target { color:#639922; }

  .ora-kpi-row { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-bottom:14px; }
  .ora-kpi { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:16px 20px; }
  .ora-kpi-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--muted); margin-bottom:6px; }
  .ora-kpi-value { font-size:28px; font-weight:800; font-family:var(--mono); }
  .ora-kpi-sub { font-size:11px; color:var(--muted); margin-top:4px; }
  .ora-signal-bar { display:flex; gap:10px; margin-bottom:20px; flex-wrap:wrap; }
  .ora-signal-pill { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; padding:5px 12px; border-radius:8px; }
  .ora-signal-pill .ora-dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
  .ora-dot-red { background:#E24B4A; }
  .ora-dot-yellow { background:#BA7517; }
  .ora-dot-green { background:#639922; }
  .ora-dot-gray { background:#B4B2A9; }
  .ora-pill-red { background:rgba(226,75,74,0.10); color:#E24B4A; }
  .ora-pill-yellow { background:rgba(186,117,23,0.10); color:#BA7517; }
  .ora-pill-green { background:rgba(99,153,34,0.10); color:#639922; }
  .ora-pill-gray { background:rgba(180,178,169,0.10); color:#B4B2A9; }

  /* Grid de cards */
  .ora-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }

  /* Card ADMEMO */
  .ora-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; border-left:3px solid var(--border); overflow:hidden; }
  .ora-card.sig-red { border-left-color:#E24B4A; }
  .ora-card.sig-yellow { border-left-color:#BA7517; }
  .ora-card.sig-green { border-left-color:#639922; }
  .ora-card.sig-gray { border-left-color:#B4B2A9; }
  .ora-card-header { padding:12px 14px 0; cursor:pointer; }
  .ora-card-header:hover { opacity:0.9; }
  .ora-card-top { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
  .ora-card-title { font-size:15px; font-weight:500; }
  .ora-card-tags { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
  .ora-chip { font-size:9px; font-weight:700; padding:2px 7px; border-radius:5px; text-transform:uppercase; letter-spacing:0.04em; }
  .ora-chip-teste { background:rgba(59,130,246,0.15); color:#60a5fa; }
  .ora-chip-pre { background:rgba(251,146,60,0.15); color:#fb923c; }
  .ora-chip-escala { background:rgba(99,153,34,0.15); color:#639922; }
  .ora-card-count { font-size:11px; color:var(--muted); margin-left:auto; white-space:nowrap; }
  .ora-card-arrow { transition:transform .2s; font-size:12px; color:var(--muted); margin-left:6px; }
  .ora-card.open .ora-card-arrow { transform:rotate(90deg); }

  /* Métricas grid */
  .ora-metrics { display:grid; grid-template-columns:repeat(4,1fr); gap:0; padding:10px 14px 14px; }
  .ora-metric { text-align:center; }
  .ora-metric:not(:last-child) { border-right:1px solid var(--border); }
  .ora-metric-val { font-size:16px; font-weight:700; font-family:var(--mono); }
  .ora-metric-label { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:0.04em; margin-top:2px; }
  .ora-cpc-green { color:#639922; }
  .ora-cpc-yellow { color:#BA7517; }
  .ora-cpc-red { color:#E24B4A; }
  .ora-profit-pos { color:#639922; }
  .ora-profit-neg { color:#E24B4A; }

  /* Rodapé do card — ação inline */
  .ora-card-footer { padding:0 14px 12px; }
  .ora-card-action { font-size:11px; padding:7px 10px; border-radius:6px; margin-bottom:4px; }
  .ora-card-action.act-pause { background:rgba(226,75,74,0.08); color:#E24B4A; font-weight:700; }
  .ora-card-action.act-create { color:var(--muted); font-style:italic; }
  .ora-action-detail { font-size:10px; color:var(--muted); font-weight:400; margin-top:2px; }

  /* Campanhas expandidas */
  .ora-card-body { display:none; padding:0 14px 14px; }
  .ora-card.open .ora-card-body { display:block; }
  /* .ora-camp is now .ora-camp-row — see below */
  .ora-camp-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text); }
  .ora-badge { font-size:9px; font-weight:700; padding:1px 6px; border-radius:4px; text-transform:uppercase; letter-spacing:0.03em; flex-shrink:0; }
  .ora-badge-nova { background:rgba(59,130,246,0.15); color:#60a5fa; }
  .ora-badge-virada { background:rgba(180,178,169,0.12); color:#B4B2A9; }
  .ora-camp-stats { display:flex; gap:12px; color:var(--muted); flex-shrink:0; flex-wrap:wrap; }
  .ora-camp-stats span { white-space:nowrap; }

  /* Ações sugeridas */
  .ora-actions-section { margin-top:20px; }
  .ora-actions-title { font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--muted); margin-bottom:10px; }
  .ora-action { display:flex; align-items:center; gap:10px; padding:10px 14px; border-radius:8px; font-size:13px; margin-bottom:6px; border-left:3px solid var(--border); }
  .ora-action.act-pause { border-left-color:#E24B4A; background:rgba(226,75,74,0.05); }
  .ora-action.act-create { border-left-color:#639922; background:rgba(99,153,34,0.05); }
  .ora-action.act-watch { border-left-color:#BA7517; background:rgba(186,117,23,0.05); }
  .ora-action .ora-dot { flex-shrink:0; }

  .ora-camp-acum { font-size:10px; color:var(--muted); margin-top:2px; width:100%; }
  .ora-camp-claude { font-size:11px; color:var(--accent); margin-top:3px; width:100%; font-style:italic; }
  .ora-sugestoes { margin-top:20px; }
  .ora-sugestoes-title { font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--muted); margin-bottom:10px; }
  .ora-sugestao { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:14px 18px; margin-bottom:8px; border-left:3px solid var(--accent); }
  .ora-sugestao-regra { font-size:13px; font-weight:700; margin-bottom:4px; }
  .ora-sugestao-ajuste { font-size:12px; color:var(--accent); margin-bottom:4px; }
  .ora-sugestao-just { font-size:11px; color:var(--muted); }
  .ora-camp-row { display:flex; flex-direction:column; padding:7px 10px; border-radius:8px; font-size:12px; font-family:var(--mono); border-left:3px solid var(--border); margin-bottom:4px; }
  .ora-camp-row:hover { background:rgba(255,255,255,0.02); }
  .ora-camp-row.sig-red { border-left-color:#E24B4A; }
  .ora-camp-row.sig-yellow { border-left-color:#BA7517; }
  .ora-camp-row.sig-green { border-left-color:#639922; }
  .ora-camp-row.sig-gray { border-left-color:#B4B2A9; }
  .ora-camp-main { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

  /* Actions detail line */
  .ora-action-sub { font-size:11px; color:var(--muted); margin-top:1px; }

  @media (max-width:768px) {
    .ora-grid { grid-template-columns:1fr; }
    .ora-kpi-row { grid-template-columns:1fr; }
    .ora-metrics { grid-template-columns:repeat(2,1fr); gap:8px; }
    .ora-metric:not(:last-child) { border-right:none; }
    .ora-kpi-value { font-size:22px; }
  }

