/* =========================================================
   BASE — fonte, cores (tokens), reset, marca Pont, tela de login e
   o layout geral (menu lateral, cabeçalho, área de conteúdo).
   Os arquivos de CSS são carregados nesta ordem (a ordem importa):
   base.css · componentes.css · consulta-cliente-e-formularios.css · produto-e-empresas.css · painel-e-dashboard.css · planilhas.css
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@800&display=swap');

/* ─── TOKENS DE DESIGN ─────────────────────────────────── */
:root {
  /* Cores Primárias */
  --primary-50:  #EFF6FF;
  --primary-100: #DBEAFE;
  --primary-200: #BFDBFE;
  --primary-300: #93C5FD;
  --primary-400: #60A5FA;
  --primary-500: #3B82F6;
  --primary-600: #2563EB;
  --primary-700: #1D4ED8;
  --primary-800: #1E40AF;
  --primary-900: #1E3A8A;
  --primary-950: #172554;

  /* Neutros */
  --gray-50:  #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;

  /* Status */
  --status-pending-bg:   #FEF3C7;
  --status-pending-text: #92400E;
  --status-pending-dot:  #F59E0B;
  --status-andamento-bg:   #DBEAFE;
  --status-andamento-text: #1E40AF;
  --status-andamento-dot:  #3B82F6;
  --status-espera-bg:   #FFEDD5;
  --status-espera-text: #9A3412;
  --status-espera-dot:  #F97316;
  --status-naoaprovado-bg:   #FEE2E2;
  --status-naoaprovado-text: #991B1B;
  --status-naoaprovado-dot:  #EF4444;
  --status-concluido-bg:   #D1FAE5;
  --status-concluido-text: #065F46;
  --status-concluido-dot:  #10B981;

  /* Cores de Sucesso/Erro/Aviso */
  --success: #10B981;
  --warning: #F59E0B;
  --danger:  #EF4444;
  --info:    #3B82F6;

  /* Sombras */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.10), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.10), 0 10px 10px rgba(0,0,0,0.04);
  --shadow-2xl: 0 25px 50px rgba(0,0,0,0.15);

  /* Raios */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Transições */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  --content-padding: 28px;
}

/* ─── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
/* Tamanho padrão de segurança para qualquer ícone SVG solto (sem uma classe
   própria definindo width/height) — evita que ele "estoure" para o tamanho
   do elemento pai. Ícones com classe específica (ex: .stat-icon svg)
   continuam usando o próprio tamanho, pois têm prioridade sobre esta regra. */
svg { width: 1em; height: 1em; flex-shrink: 0; }

/* ─── BRAND / LOGO ───────────────────────────────────────── */
/* Patch 5: logo em texto no menu lateral, igual à tela de login */
.sidebar-logo-texto { font-size: 1.3rem; font-weight: 800; line-height: 1.08; color: #fff; letter-spacing: -0.01em; }
/* Marca Pont (04/10/2026): ícone da ponte + "Pont" + "Grupo Dupont".
   Pont = "ponte" em francês, e está dentro do nome: Du-pont. */
.marca-pont { display: flex; align-items: center; gap: 12px; }
.marca-pont-icone { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; box-shadow: 0 6px 16px rgba(3,47,122,0.35); }
.marca-pont-nome { display: flex; flex-direction: column; line-height: 1; }
.marca-pont-nome b { font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; font-weight: 800; font-size: 1.55rem; letter-spacing: -0.02em; color: #fff; }
.marca-pont-nome small { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.65); margin-top: 5px; }
.sidebar-logo .marca-pont-icone { width: 36px; height: 36px; }
.sidebar-logo .marca-pont-nome b { font-size: 1.35rem; }
.sidebar-logo .marca-pont-nome small { color: var(--gray-500); }
.login-marca-mobile { display: none; }
/* Carregando: um ponto atravessa a ponte */
.pont-carregando { width: 64px; height: 64px; }
.pont-viajante { animation: pont-atravessa 1.6s ease-in-out infinite; }
@keyframes pont-atravessa { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(37px); } }
@media (prefers-reduced-motion: reduce) { .pont-viajante { animation: none; } }

/* ─── LOGIN PAGE ─────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-700) 50%, var(--primary-500) 100%);
  position: relative;
  overflow: hidden;
}
.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
}
.login-logo-text {
  position: absolute; top: 48px; left: 60px;
  font-size: 1.7rem; font-weight: 800; line-height: 1.08;
  color: #fff; letter-spacing: -0.01em; z-index: 1;
}
.login-logo-text .marca-pont-icone { width: 48px; height: 48px; border-radius: 12px; }
.login-logo-text .marca-pont-nome b { font-size: 1.9rem; }
.login-footer {
  position: absolute; bottom: 40px; left: 60px; right: 60px;
  padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.18);
  font-size: 0.78rem; color: rgba(255,255,255,0.55); z-index: 1;
}
.login-deco-line { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.login-deco-dots {
  position: absolute; right: 36px; bottom: 36px;
  width: 130px; height: 90px;
  background-image: radial-gradient(rgba(255,255,255,0.35) 1.5px, transparent 1.5px);
  background-size: 16px 16px;
  pointer-events: none;
}
.login-brand { max-width: 440px; position: relative; z-index: 1; }
.login-brand h1 { font-size: 2.25rem; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 16px; }
.login-brand p { font-size: 1.05rem; color: rgba(255,255,255,0.75); line-height: 1.7; }
.login-accent { color: #7DD3FC; }
.login-features { margin-top: 40px; display: flex; flex-direction: column; gap: 20px; }
.login-feature { display: flex; align-items: flex-start; gap: 14px; }
.login-feature-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.login-feature-text h4 { font-size: 0.92rem; font-weight: 700; color: #fff; margin-bottom: 2px; }
.login-feature-text p { font-size: 0.82rem; color: rgba(255,255,255,0.7); line-height: 1.4; }
.login-right {
  width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  position: relative;
  z-index: 1;
}
.login-form-container {
  width: 100%; max-width: 420px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
  padding: 48px 44px;
}
.login-form-header { margin-bottom: 36px; }
.login-form-header h2 { font-size: 1.6rem; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.login-form-header p { color: var(--gray-500); font-size: 0.9rem; }
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--gray-800);
  background: var(--gray-50);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  outline: none;
}
.form-input:focus { border-color: var(--primary-500); background: #fff; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-input.error { border-color: var(--danger); }
.form-input-icon-wrap { position: relative; }
.form-input-icon-wrap .form-input { padding-left: 42px; }
.form-input-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--gray-400); pointer-events: none; }
.form-input.has-toggle { padding-right: 40px; }
.password-toggle-btn {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 0; margin: 0;
  color: var(--gray-400); cursor: pointer; display: flex; line-height: 0;
}
.password-toggle-btn:hover { color: var(--gray-600); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 11px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem; font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer; border: 1.5px solid transparent;
  white-space: nowrap; position: relative; overflow: hidden;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #fff; border-color: var(--primary-700);
  box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-700), var(--primary-800)); box-shadow: 0 4px 12px rgba(37,99,235,0.4); transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--gray-700); border-color: var(--gray-200); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-ghost { background: transparent; color: var(--gray-600); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }
.btn-danger { background: var(--danger); color: #fff; border-color: #DC2626; }
.btn-danger:hover { background: #DC2626; }
.btn-success { background: var(--success); color: #fff; border-color: #059669; }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--warning); color: #fff; border-color: #D97706; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn-icon { padding: 9px; border-radius: var(--radius-md); }
.btn-icon svg { width: 18px; height: 18px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-white { background: #fff; color: var(--primary-700); border-color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.btn-white:hover { background: var(--primary-50); transform: translateY(-1px); }
.login-alert {
  background: var(--status-naoaprovado-bg); color: var(--status-naoaprovado-text);
  border: 1px solid rgba(239,68,68,0.2); border-radius: var(--radius-md);
  padding: 12px 16px; font-size: 0.85rem; margin-bottom: 20px; display: none;
}
.login-alert.show { display: block; }
.demo-user {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px; border-bottom: 1px solid var(--gray-200);
  cursor: pointer; border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.demo-user:last-child { border-bottom: none; }
.demo-user:hover { background: var(--primary-50); }
.demo-user span:first-child { font-size: 0.82rem; color: var(--gray-700); font-weight: 500; }
.demo-user span:last-child { font-size: 0.75rem; color: var(--gray-400); }

/* ─── MAIN LAYOUT ────────────────────────────────────────── */
.app-wrapper { display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width); height: 100vh;
  background: var(--gray-900);
  display: flex; flex-direction: column;
  flex-shrink: 0; position: fixed;
  left: 0; top: 0; z-index: 100;
  transition: transform var(--transition-base);
}
.sidebar-logo {
  padding: 20px 22px; border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-logo-icon svg { width: 20px; height: 20px; color: #fff; }
.sidebar-logo-text h2 { font-size: 0.88rem; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-logo-text span { font-size: 0.72rem; color: var(--gray-500); }
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.nav-section-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--gray-600); padding: 12px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: var(--radius-md); color: var(--gray-400);
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition-fast); position: relative; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--gray-100); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(37,99,235,0.12));
  color: var(--primary-300); font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--primary-400); border-radius: 0 3px 3px 0;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 0.68rem; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.sidebar-footer { padding: 14px 12px; border-top: 1px solid rgba(255,255,255,0.06); }
.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: var(--radius-md); cursor: pointer;
  transition: background var(--transition-fast);
}
.sidebar-user:hover { background: rgba(255,255,255,0.06); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-info .name { font-size: 0.82rem; font-weight: 600; color: var(--gray-200); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info .role { font-size: 0.7rem; color: var(--gray-500); }
.sidebar-user svg { width: 16px; height: 16px; color: var(--gray-500); }

/* HEADER */
.main-area { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; min-height: 100vh; overflow: hidden; }
.header {
  height: var(--header-height); background: #fff; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; padding: 0 var(--content-padding); gap: 16px;
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
}
.header-menu-btn {
  display: flex; align-items: center; justify-content: center; padding: 8px; border-radius: var(--radius-md);
  color: var(--gray-600); transition: background var(--transition-fast);
}
.header-menu-btn:hover { background: var(--gray-100); }
.header-menu-btn svg { width: 20px; height: 20px; }
.header-breadcrumb { flex: 1; display: flex; align-items: center; gap: 8px; }
.header-breadcrumb h1 { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); }
.header-breadcrumb .breadcrumb-sep { color: var(--gray-300); }
.header-breadcrumb .breadcrumb-sub { font-size: 0.85rem; color: var(--gray-500); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.notification-btn {
  position: relative; width: 38px; height: 38px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); transition: all var(--transition-fast); cursor: pointer;
}
.notification-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.notification-btn svg { width: 20px; height: 20px; }
.notification-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; background: var(--danger);
  border-radius: 50%; border: 2px solid #fff; display: none;
}
.notification-dot.show { display: block; }

/* CONTENT AREA */
.content { flex: 1; overflow-y: auto; padding: var(--content-padding); scrollbar-width: thin; scrollbar-color: var(--gray-300) transparent; }
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.sidebar-overlay.show { display: block; }
