/* ===== Portal do Cliente - estilos ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

  :root {
    --bg: #0a1636;
    --surface: #111d38;
    --surface2: #0d1832;
    --surface3: #18274f;
    --border: #22345f;
    --accent: #2A4EE6;
    --accent2: #5B86FF;
    --teal: #2EE0C4;
    --ciano: #28C9E8;
    --accent-glow: rgba(42,78,230,0.20);
    --text: #eaeefb;
    --muted: #9AA4BD;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --white: #eeeefb;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body { background: linear-gradient(180deg, #0a1636 0%, #08122e 50%, #0a1636 100%); color: var(--text); font-family: 'Inter', sans-serif; min-height: 100vh; overflow-x: hidden; }

  /* ── LANDING ── */
  #landing { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(180deg, #0a1636 0%, #08122e 60%, #0a1636 100%); position: relative; overflow: hidden; }
  .landing-bg {
    position: absolute; inset: 0; pointer-events: none;
    background:
      radial-gradient(ellipse 70% 55% at 50% 10%, rgba(42,78,230,0.10) 0%, transparent 60%),
      radial-gradient(ellipse 40% 30% at 85% 85%, rgba(42,78,230,0.06) 0%, transparent 50%);
  }
  .landing-nav {
    position: relative; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 56px; border-bottom: 1px solid rgba(26,58,92,0.5);
  }
  .logo { font-family: 'Inter', sans-serif; font-size: 22px; font-weight: 700; color: var(--white); letter-spacing: -0.5px; user-select: none; display: inline-flex; align-items: center; gap: 9px; text-decoration: none; cursor: pointer; opacity: 1; transition: opacity 0.2s; }
  .logo:hover { opacity: 0.8; }
  .logo span { color: var(--accent); }
  .portal-logo-img { height: 46px; width: auto; display: block; }
  .landing-nav-right { display: flex; align-items: center; gap: 8px; }
  .nav-tag { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); background: rgba(26,58,92,0.5); border: 1px solid var(--border); border-radius: 100px; padding: 5px 14px; }
  .landing-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px 24px; position: relative; z-index: 1; }
  .landing-content { display: grid; grid-template-columns: 1fr 420px; gap: 80px; align-items: center; max-width: 1000px; width: 100%; }
  .landing-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(42,78,230,0.09); border: 1px solid rgba(42,78,230,0.25);
    border-radius: 100px; padding: 6px 16px; margin-bottom: 28px;
    font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent2);
  }
  .landing-eyebrow::before { content: ''; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; animation: pulse 2s infinite; }
  @keyframes pulse { 0%,100%{opacity:1;}50%{opacity:.35;} }
  .landing-h1 { font-family: 'Inter', sans-serif; font-size: clamp(32px, 4vw, 54px); font-weight: 700; line-height: 1.08; letter-spacing: -1.5px; margin-bottom: 20px; color: var(--white); }
  .landing-h1 em { font-style: normal; color: var(--accent); }
  .landing-sub { font-size: 15px; color: var(--muted); line-height: 1.75; max-width: 420px; margin-bottom: 36px; }
  .landing-stats { display: flex; gap: 28px; flex-wrap: wrap; }
  .lstat-num { font-family: 'Inter', sans-serif; font-size: 26px; font-weight: 700; color: var(--accent); }
  .lstat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

  .portal-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; pointer-events: none; }
  .login-card { width: 100%; max-width: 400px; margin: 0 auto; min-height: 440px; display: flex; flex-direction: column; justify-content: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 48px 38px; box-shadow: 0 24px 60px rgba(0,0,0,0.45), 0 0 50px rgba(42,78,230,0.10); position: relative; overflow: hidden; }
  .login-card-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; }
  .login-brand-symbol { height: 70px; width: auto; display: block; }
  .login-brand-word { width: 100px; max-width: 72%; height: auto; display: block; }
  .login-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--teal), transparent); }
  .login-card-header { margin-bottom: 32px; }
  .login-card-label { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #4ADEDD; margin-bottom: 12px; }
  .login-card-title { font-family: 'Inter', sans-serif; font-size: 25px; font-weight: 700; color: var(--white); }
  .login-card-sub { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.6; }
  .form-group { margin-bottom: 20px; }
  .form-label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.5px; display: block; margin-bottom: 8px; text-transform: uppercase; }
  .form-input { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; -webkit-appearance: none; appearance: none; }
  .form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42,78,230,0.12); }
  .form-input::placeholder { color: var(--muted); }
  .login-error { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); border-radius: 10px; padding: 12px 16px; font-size: 13px; color: #fca5a5; margin-bottom: 16px; align-items: center; gap: 8px; display: flex; }
  .login-error.hidden { display: none; }
  .login-error.visible { display: flex; }
  .btn-login { width: 100%; background: var(--accent); border: none; border-radius: 10px; padding: 15px; color: var(--white); font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s; box-shadow: 0 0 32px var(--accent-glow); display: flex; align-items: center; justify-content: center; gap: 8px; -webkit-appearance: none; appearance: none; }
  .btn-login:hover { background: var(--accent2); transform: translateY(-1px); }
  .btn-login:active { transform: none; }
  .login-footer { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; font-size: 13px; color: var(--muted); }
  .login-footer span { color: var(--accent); }

  /* ── MODAL ── */
  #loginModal { display: none; position: fixed; inset: 0; z-index: 500; background: rgba(6,13,24,0.88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); align-items: center; justify-content: center; padding: 24px; }
  #loginModal.open { display: flex; }
  .modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 44px 40px; max-width: 420px; width: 100%; position: relative; animation: modalIn 0.25s ease; box-shadow: 0 40px 80px rgba(0,0,0,0.5), 0 0 60px rgba(42,78,230,0.10); }
  .modal-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--teal), transparent); }
  @keyframes modalIn { from{opacity:0;transform:translateY(20px) scale(0.96);}to{opacity:1;transform:none;} }
  .modal-close-btn { position: absolute; top: 16px; right: 16px; background: transparent; border: 1px solid var(--border); color: var(--muted); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
  .modal-close-btn:hover { border-color: var(--accent); color: var(--white); }
  .modal-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
  .modal-logo-icon { width: 40px; height: 40px; background: var(--accent); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 700; color: white; }
  .modal-logo-text { font-family: 'Inter', sans-serif; font-size: 18px; font-weight: 700; color: var(--white); }
  .modal-logo-text span { color: var(--accent); }
  .modal-title { font-family: 'Inter', sans-serif; font-size: 20px; font-weight: 700; color: var(--white); margin-bottom: 4px; }
  .modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 28px; line-height: 1.5; }

  /* ── DASHBOARD ── */
  #dashboard { display: none; min-height: 100vh; background: linear-gradient(180deg, #0a1636 0%, #08122e 55%, #0a1636 100%); }
  #dashboard.active { display: block; }
  .dash-nav { position: sticky; top: 0; z-index: 100; background: rgba(10,19,46,0.85); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 48px; height: 68px; }
  .dash-nav-left { display: flex; align-items: center; gap: 32px; }
  .dash-nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
  .dash-nav-link { background: transparent; border: none; color: var(--muted); padding: 8px 16px; border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
  .dash-nav-link:hover, .dash-nav-link.active { background: rgba(42,78,230,0.1); color: var(--accent2); }
  .dash-nav-right { display: flex; align-items: center; gap: 12px; }
  .client-badge { display: flex; align-items: center; gap: 8px; background: rgba(42,78,230,0.08); border: 1px solid rgba(42,78,230,0.2); border-radius: 100px; padding: 6px 14px; }
  .client-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
  .client-name { font-size: 12px; font-weight: 600; color: var(--accent2); }
  .btn-logout { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 8px 16px; border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 12px; cursor: pointer; transition: all 0.2s; }
  .btn-logout:hover { border-color: var(--danger); color: #fca5a5; }
  .dash-section { display: none; }
  .dash-section.active { display: block; }

  .dash-hero { background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%); border-bottom: 1px solid var(--border); padding: 56px 48px; position: relative; overflow: hidden; }
  .dash-hero::before { content: ''; position: absolute; right: -100px; top: -100px; width: 400px; height: 400px; background: radial-gradient(circle, rgba(42,78,230,0.08) 0%, transparent 60%); pointer-events: none; }
  .dash-hero-label { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--teal); margin-bottom: 10px; }
  .dash-hero-title { font-family: 'Inter', sans-serif; font-size: 32px; font-weight: 700; color: var(--white); letter-spacing: -0.5px; margin-bottom: 8px; }
  .dash-hero-sub { font-size: 15px; color: var(--muted); max-width: 600px; line-height: 1.7; }

  .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 36px 48px; }
  .kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px; position: relative; overflow: hidden; transition: border-color 0.2s; }
  .kpi-card:hover { border-color: var(--accent); }
  .kpi-label { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
  .kpi-value { font-family: 'Inter', sans-serif; font-size: 32px; font-weight: 700; color: var(--white); margin-bottom: 4px; }
  .kpi-value.success { color: var(--success); }
  .kpi-delta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
  .kpi-delta.up { color: var(--success); }

  .dash-content { padding: 0 48px 56px; }
  .section-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
  .section-row.full { grid-template-columns: 1fr; }
  .section-row.thirds { grid-template-columns: 1fr 1fr 1fr; }
  .card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px; }
  .card-title { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 600; color: var(--white); margin-bottom: 4px; }
  .card-sub { font-size: 12px; color: var(--muted); margin-bottom: 20px; }

  .problem-list { display: flex; flex-direction: column; gap: 12px; }
  .problem-item { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; gap: 14px; align-items: flex-start; transition: border-color 0.2s; }
  .problem-item:hover { border-color: rgba(46,224,196,0.35); }
  .problem-num { background: rgba(42,78,230,0.12); border: 1px solid rgba(42,78,230,0.2); border-radius: 8px; width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--accent); }
  .problem-title { font-size: 14px; font-weight: 600; color: var(--white); margin-bottom: 3px; }
  .problem-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

  .bar-chart { display: flex; flex-direction: column; gap: 14px; }
  .bar-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
  .bar-label { font-size: 12px; color: var(--muted); }
  .bar-track { background: var(--surface2); border-radius: 100px; height: 8px; overflow: hidden; }
  .bar-fill { height: 100%; background: var(--accent); border-radius: 100px; transition: width 1s ease; }
  .bar-fill.success { background: var(--success); }
  .bar-fill.warning { background: var(--warning); }

  .prog-bar { height: 6px; background: var(--surface2); border-radius: 100px; overflow: hidden; }
  .prog-fill { height: 100%; border-radius: 100px; background: var(--accent); }

  .dash-footer { border-top: 1px solid var(--border); padding: 24px 40px; display: flex; align-items: center; justify-content: space-between; }
  .dash-footer p { font-size: 12px; color: var(--muted); }

  /* ── SUÍTE DE IA ── */
  .ia-tab-btn { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; padding: 8px 18px; border-radius: 100px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; transition: all 0.2s; letter-spacing: 0.3px; }
  .ia-tab-btn:hover { border-color: var(--accent); color: var(--accent); }
  .ia-tab-active { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
  .ia-chat-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: 0 0 40px rgba(42,78,230,0.05); }
  .ia-chat-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; background: var(--surface2); }
  .ia-messages { height: 400px; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
  .ia-messages::-webkit-scrollbar { width: 4px; }
  .ia-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
  .ia-bubble { display: flex; gap: 8px; max-width: 90%; }
  .ia-bubble.user { align-self: flex-end; flex-direction: row-reverse; }
  .ia-avatar { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; margin-top: 2px; }
  .ia-text { padding: 11px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.65; }
  .ia-bubble.bot .ia-text { background: var(--surface2); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
  .ia-bubble.user .ia-text { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
  .ia-typing-wrap { padding: 0 20px 8px; display: flex; gap: 8px; align-items: center; }
  .ia-typing-dots { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; border-bottom-left-radius: 4px; padding: 12px 16px; display: flex; gap: 4px; align-items: center; }
  .ia-input-wrap { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface2); }
  .ia-preview { margin-bottom: 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
  .ia-attach-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; flex-shrink: 0; }
  .ia-attach-btn:hover { border-color: var(--accent); color: var(--accent); }
  .ia-clear-btn { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 5px 12px; border-radius: 8px; font-size: 11px; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.2s; }
  .ia-clear-btn:hover { border-color: var(--accent); color: var(--accent); }
  .ia-sugg { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); padding: 9px 12px; border-radius: 10px; font-size: 12px; font-family: 'Inter', sans-serif; cursor: pointer; text-align: left; transition: all 0.2s; line-height: 1.4; width: 100%; }
  .ia-sugg:hover { border-color: var(--accent); color: var(--accent2); background: rgba(42,78,230,0.05); }

  .chat-input { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 14px; outline: none; transition: border-color 0.2s; }
  .chat-input:focus { border-color: var(--accent); }
  .send-btn { width: 44px; height: 44px; flex-shrink: 0; background: var(--accent); border: none; border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
  .send-btn:hover { background: var(--accent2); }
  .typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite; }
  .typing-dot:nth-child(2) { animation-delay: 0.2s; }
  .typing-dot:nth-child(3) { animation-delay: 0.4s; }
  @keyframes typing { 0%,60%,100%{opacity:0.3;transform:translateY(0);} 30%{opacity:1;transform:translateY(-3px);} }
  @keyframes fadeIn { from{opacity:0;transform:translateY(6px);} to{opacity:1;transform:none;} }

  /* =========================================================
     POLIMENTO VISUAL — mais vida, movimento e profundidade
     ========================================================= */

  /* Fundo do dashboard com brilhos de marca (profundidade) */
  #dashboard {
    background:
      radial-gradient(720px circle at 10% 0%, rgba(42,78,230,0.13) 0%, transparent 55%),
      radial-gradient(640px circle at 92% 8%, rgba(46,224,196,0.07) 0%, transparent 55%),
      radial-gradient(760px circle at 88% 100%, rgba(40,201,232,0.06) 0%, transparent 55%),
      linear-gradient(180deg, #0a1636 0%, #08122e 55%, #0a1636 100%);
  }

  /* Tema/acento próprio de cada aba (definido via data-tab pelo JS) */
  #dashboard { --tab-accent: var(--accent2); --tab-glow: rgba(42,78,230,0.10); }
  #dashboard[data-tab="overview"]    { --tab-accent: #5B86FF; --tab-glow: rgba(42,78,230,0.14); }
  #dashboard[data-tab="diagnostico"] { --tab-accent: #F59E0B; --tab-glow: rgba(245,158,11,0.13); }
  #dashboard[data-tab="solucoes"]    { --tab-accent: #2EE0C4; --tab-glow: rgba(46,224,196,0.13); }
  #dashboard[data-tab="resultados"]  { --tab-accent: #10B981; --tab-glow: rgba(16,185,129,0.13); }
  #dashboard[data-tab="equipe"]      { --tab-accent: #28C9E8; --tab-glow: rgba(40,201,232,0.13); }
  #dashboard[data-tab="comparativo"] { --tab-accent: #8B5CF6; --tab-glow: rgba(139,92,246,0.13); }

  .dash-hero-label { color: var(--tab-accent); transition: color 0.4s ease; }
  .dash-hero::before { background: radial-gradient(circle, var(--tab-glow) 0%, transparent 60%); }
  .dash-hero::after {
    content: ''; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
    background: linear-gradient(90deg, var(--tab-accent), transparent 75%);
    opacity: 0.9;
  }

  /* Entrada suave da seção ao trocar de aba */
  .dash-section.active { animation: sectionIn 0.55s cubic-bezier(0.22,0.61,0.36,1); }
  @keyframes sectionIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

  /* Cascata dos KPIs, falhas e barras dentro da seção ativa */
  .dash-section.active .kpi-card,
  .dash-section.active .problem-item,
  .dash-section.active .bar-label-row { animation: riseIn 0.5s ease both; }
  @keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  .dash-section.active .kpi-card:nth-child(2),
  .dash-section.active .problem-item:nth-child(2) { animation-delay: 0.07s; }
  .dash-section.active .kpi-card:nth-child(3),
  .dash-section.active .problem-item:nth-child(3) { animation-delay: 0.14s; }
  .dash-section.active .kpi-card:nth-child(4),
  .dash-section.active .problem-item:nth-child(4) { animation-delay: 0.21s; }
  .dash-section.active .problem-item:nth-child(5) { animation-delay: 0.28s; }

  /* Hero com brilho que respira */
  .dash-hero::before { animation: heroGlow 9s ease-in-out infinite; will-change: transform, opacity; }
  @keyframes heroGlow {
    0%, 100% { transform: translate(0,0) scale(1); opacity: 0.7; }
    50%      { transform: translate(-40px,28px) scale(1.15); opacity: 1; }
  }

  /* Cards: elevam e ganham brilho ao passar o mouse */
  .card { transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease; }
  .card:hover { transform: translateY(-4px); border-color: rgba(46,224,196,0.35); box-shadow: 0 18px 44px rgba(0,0,0,0.38); }

  /* KPI cards: elevação + barra de acento animada na base */
  .kpi-card { transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease; }
  .kpi-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 20px 46px rgba(0,0,0,0.4), 0 0 40px rgba(42,78,230,0.12); }
  .kpi-card::after {
    content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--tab-accent), var(--teal));
    transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease;
  }
  .kpi-card:hover::after { transform: scaleX(1); }

  /* Itens de falha reagindo ao hover */
  .problem-item { transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease; }
  .problem-item:hover { transform: translateX(5px); background: var(--surface3); }

  /* Blocos de conteúdo (tiles inline) clareiam suavemente ao hover */
  .dash-section [style*="background:var(--surface);"] { transition: background 0.25s ease, box-shadow 0.25s ease; }
  .dash-section [style*="background:var(--surface);"]:hover { background: var(--surface3) !important; box-shadow: 0 10px 30px rgba(0,0,0,0.28); }

  /* Barras de impacto com brilho passando */
  .bar-fill { position: relative; overflow: hidden; }
  .bar-fill::after {
    content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 40%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
    transform: translateX(-120%); animation: barShine 3.4s ease-in-out infinite;
  }
  @keyframes barShine { 0% { transform: translateX(-120%); } 55%, 100% { transform: translateX(320%); } }

  /* Navegação: item ativo com contorno luminoso */
  .dash-nav-link.active { box-shadow: inset 0 0 0 1px rgba(91,134,255,0.35); }

  /* Abas de IA e sugestões */
  .ia-tab-btn:hover { transform: translateY(-1px); }
  .ia-tab-active { box-shadow: 0 6px 20px rgba(42,78,230,0.4); }
  .ia-sugg:hover { transform: translateX(3px); }

  /* Botões principais com gradiente e brilho */
  .btn-login { background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 100%); transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease; }
  .btn-login:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 14px 34px rgba(42,78,230,0.45); background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 100%); }
  .send-btn { transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }
  .send-btn:hover { transform: translateY(-1px) scale(1.04); box-shadow: 0 8px 22px rgba(42,78,230,0.45); }
  .btn-logout:hover { transform: translateY(-1px); }
  .client-badge { transition: border-color 0.2s ease, box-shadow 0.2s ease; }
  .client-badge:hover { box-shadow: 0 0 22px rgba(42,78,230,0.18); }
  .client-dot { animation: dotPulse 2.4s ease-in-out infinite; }
  @keyframes dotPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(42,78,230,0.5); } 50% { box-shadow: 0 0 0 5px rgba(42,78,230,0); } }

  /* Barra de rolagem da página, no tom da marca */
  #dashboard ::-webkit-scrollbar,
  .dash-section ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(91,134,255,0.22); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(91,134,255,0.38); background-clip: padding-box; }

  /* Acessibilidade: quem prefere menos movimento não vê animações */
  @media (prefers-reduced-motion: reduce) {
    .dash-section.active,
    .dash-section.active .kpi-card,
    .dash-section.active .problem-item,
    .dash-section.active .bar-label-row,
    .dash-hero::before,
    .bar-fill::after,
    .client-dot { animation: none !important; }
    .card:hover, .kpi-card:hover, .problem-item:hover, .btn-login:hover,
    .send-btn:hover, .ia-sugg:hover, .ia-tab-btn:hover { transform: none !important; }
  }

  /* =========================================================
     REFINAMENTO MINIMALISTA — menos ruído, mais respiro
     ========================================================= */

  /* Escala tipográfica mais contida e calma */
  .dash-hero { padding: 40px 48px 38px; }
  .dash-hero-title { font-size: 25px; }
  .dash-hero-sub { font-size: 13.5px; max-width: 640px; }
  .dash-hero-label { font-size: 10.5px; letter-spacing: 1.5px; }
  .card-title { font-size: 15px; }
  .kpi-value { font-size: 23px; }
  .dash-section [style*="font-size:42px"] { font-size: 30px !important; }
  .dash-section [style*="font-size:36px"] { font-size: 25px !important; }
  .dash-section [style*="font-size:32px"] { font-size: 23px !important; }
  .dash-section [style*="font-size:28px"] { font-size: 22px !important; }
  .dash-section [style*="font-size:24px"] { font-size: 20px !important; }

  /* Menos ruído de cor: neutraliza as caixas tingidas de vermelho/verde */
  .dash-section [style*="rgba(239,68,68,0.06)"],
  .dash-section [style*="rgba(16,185,129,0.06)"] {
    background: transparent !important;
    border-color: var(--border) !important;
  }

  /* Chips do plano mais leves (só o traço de acento à esquerda) */
  .dash-section [style*="border-left:2px solid"] { background: transparent !important; }

  /* Superfícies mais planas; hovers sutis (menos "pulo") */
  .card { border-radius: 16px; }
  .card:hover { transform: translateY(-2px); border-color: var(--border); box-shadow: 0 10px 26px rgba(0,0,0,0.26); }
  .kpi-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,0.26); }
  .problem-item:hover { transform: none; }
  .dash-section [style*="background:var(--surface);"]:hover { box-shadow: none; }

  /* Suíte de IA menos densa e mais calma */
  .ia-tab-btn { padding: 7px 15px; font-size: 11.5px; }
  .ia-chat-header { padding: 12px 18px; }
  .ia-messages { height: 360px; padding: 18px; gap: 10px; }
  .ia-sugg { padding: 8px 11px; font-size: 11.5px; }
  .ia-text { font-size: 13px; padding: 10px 13px; }
  .ia-avatar { width: 26px; height: 26px; }

  /* ===== Tablets e celulares ===== */
  @media (max-width: 900px) {
    .landing-content { grid-template-columns: 1fr; gap: 40px; }
    .section-row, .section-row.thirds { grid-template-columns: 1fr; }

    /* Navegação do dashboard empilhada e centralizada */
    .dash-nav { flex-direction: column; height: auto; gap: 10px; padding: 12px 20px; }
    .dash-nav-left { flex-direction: column; gap: 10px; width: 100%; }
    .dash-nav-links { justify-content: center; flex-wrap: wrap; }
    .dash-nav-right { flex-wrap: wrap; justify-content: center; }

    /* Menos padding lateral em telas menores */
    .dash-nav, .dash-hero, .kpi-grid, .dash-content, .dash-footer { padding-left: 20px; padding-right: 20px; }
    .landing-nav { padding: 18px 20px; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }

    /* Colapsa TODOS os grids em 1 coluna — inclusive os definidos em style inline
       (métricas, diagnóstico, soluções, objetivo, abas de IA, comparativo). */
    .dash-section [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    /* Bloco de métricas da Visão Geral (margem lateral inline) */
    .dash-section > [style*="margin:24px 48px 28px"] { margin-left: 20px !important; margin-right: 20px !important; }
  }

  /* ===== Celulares ===== */
  @media (max-width: 600px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .landing-main { padding: 40px 18px; }
    .dash-hero { padding: 34px 20px; }
    .dash-hero-title { font-size: 26px; }
    .dash-hero-sub { font-size: 14px; }
    .dash-content { padding: 0 20px 40px; }
    .card { padding: 22px; }
    .ia-messages { height: 340px; }
    .ia-tab-btn { padding: 7px 14px; font-size: 11px; }
    .login-card { padding: 40px 26px; }
    .modal-card { padding: 36px 26px; }
  }
