/* Layout base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #0f172a;
  color: #0f172a;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.75rem;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #f9fafb;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: #9ca3af;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link {
  color: #e5e7eb;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.nav-link:hover {
  background: rgba(148, 163, 184, 0.16);
  transform: translateY(-1px);
}

.nav-link-primary {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #f9fafb;
}

.nav-link-primary:hover {
  background: linear-gradient(135deg, #4338ca, #0891b2);
}

.nav-link-logout {
  color: #fecaca;
}

.nav-link-logout:hover {
  background: rgba(248, 113, 113, 0.18);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #f9fafb;
  font-weight: 600;
}

.user-name {
  font-size: 0.8rem;
  color: #e5e7eb;
}

/* Conteúdo principal */

.main-content {
  flex: 1;
  padding: 2rem 1.5rem 2.5rem;
}

/* Rodapé */

.footer {
  padding: 0.75rem 1.75rem;
  font-size: 0.75rem;
  color: #9ca3af;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.98);
}

/* Página de login */

.login-body {
  background: radial-gradient(circle at top left, #1d4ed8 0, #020617 45%, #020617 100%);
}

.login-wrapper {
  max-width: 960px;
  margin: 3.5rem auto;
  padding: 0 1rem;
}

.login-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 0;
  background: rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.login-hero {
  padding: 2.25rem 2.25rem 2.5rem;
  background: radial-gradient(
      circle at top left,
      rgba(96, 165, 250, 0.4),
      transparent 55%
    ),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.25), transparent 45%),
    #020617;
  border-right: 1px solid rgba(30, 64, 175, 0.4);
}

.login-hero h1 {
  font-size: 1.8rem;
  margin: 0 0 0.75rem;
  color: #f9fafb;
}

.login-hero p {
  margin: 0;
  font-size: 0.95rem;
  color: #cbd5f5;
  max-width: 26rem;
}

.login-highlight {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  font-size: 0.7rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.pill-success {
  background: rgba(22, 163, 74, 0.95);
  border-color: rgba(22, 163, 74, 1);
  color: #ecfdf5;
}

.pill-outline {
  border-color: rgba(148, 163, 184, 0.7);
  color: #e5e7eb;
  background: transparent;
}

.login-metric {
  margin-top: 2.25rem;
}

.metric-value {
  display: block;
  font-size: 2.2rem;
  font-weight: 700;
  color: #bfdbfe;
}

.metric-label {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Lado direito (formulário) */

.login-form-area {
  padding: 2.5rem 2.25rem;
  background: #020617;
}

.login-form-area h2 {
  margin: 0 0 0.35rem;
  color: #f9fafb;
}

.login-subtitle {
  margin: 0 0 1.75rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.login-form label {
  font-size: 0.8rem;
  color: #cbd5f5;
}

.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
  width: 100%;
  padding: 0.55rem 2.5rem 0.55rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 0.9rem;
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus,
.login-form input[type="text"]:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.35);
  background: #020617;
}

.login-form input::placeholder {
  color: #4b5563;
}


.btn-primary {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  border: none;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #f9fafb;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.75);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca, #0891b2);
  transform: translateY(-1px);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.85);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.7);
}

.login-hint {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: #374151;
  opacity: 0.6;
}

/* Alertas */

.alert {
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  font-size: 0.8rem;
}

.alert-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

/* Dashboard simples (quando logado) */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 1rem;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #e5e7eb;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.card p {
  margin: 0;
  font-size: 0.83rem;
  color: #9ca3af;
}

/* Responsividade */

@media (max-width: 840px) {
  .login-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-hero {
    display: none;
  }

  .login-wrapper {
    margin-top: 2.5rem;
  }
}
/* Cabeçalho das páginas internas */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  color: #e5e7eb;
}

.page-header h2 {
  margin: 0 0 0.25rem;
}

.page-header p {
  margin: 0;
  font-size: 0.85rem;
  color: #9ca3af;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* KPIs do dashboard */

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kpi-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 600;
  color: #e5e7eb;
}

.kpi-caption {
  font-size: 0.78rem;
  color: #6b7280;
}

/* Seção secundária do dashboard */

.dashboard-secondary {
  margin-top: 1.75rem;
}

.dashboard-secondary-header h3 {
  margin: 0 0 0.5rem;
}

.next-steps {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Upload NF-e */

.upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.5rem;
}

.upload-card h3,
.upload-info h3 {
  margin-top: 0;
}

.upload-subtitle {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 1.25rem;
}

.upload-form {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dropzone {
  border-radius: 1rem;
  border: 1.5px dashed rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  padding: 1.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.dropzone-inner {
  text-align: center;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.dropzone-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.dropzone-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #9ca3af;
}

.dropzone-hover {
  border-color: #4f46e5;
  background: rgba(30, 64, 175, 0.4);
  transform: translateY(-1px);
}

.link {
  color: #60a5fa;
  text-decoration: underline;
}

.upload-btn {
  margin-top: 0.75rem;
  align-self: flex-start;
}

.upload-status {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
}

.upload-status.ok {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.7);
  color: #bbf7d0;
}

.upload-status.error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.upload-steps {
  list-style: none;
  padding-left: 0;
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.upload-tip {
  font-size: 0.8rem;
  color: #6b7280;
}

/* Responsivo upload */

@media (max-width: 900px) {
  .upload-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Grid e cards base (se ainda não tiver) */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 1.25rem;
  max-width: 1180px;
  width: 100%;
  margin: 1.5rem auto 0;
  justify-content: center;
}

.module-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 210px;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 1rem;
  padding: 1.2rem 1.3rem;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.4);
  text-decoration: none;
  color: #e5e7eb;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease,
    background 0.12s ease;
}

.module-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.9);
  border-color: rgba(96, 165, 250, 0.8);
}

.module-icon {
  width: 34px;
  height: 34px;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}

.module-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.module-card p {
  margin: 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

.module-tag {
  margin-top: 0.45rem;
  align-self: flex-start;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 0.72rem;
  color: #cbd5f5;
}

@media (max-width: 1200px) {
  .modules-grid {
    grid-template-columns: repeat(3, minmax(240px, 1fr));
  }
}

@media (max-width: 900px) {
  .modules-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 640px) {
  .modules-grid {
    grid-template-columns: 1fr;
  }
}

.module-card--reports {
  position: relative;
  border-color: rgba(56, 189, 248, 0.55);
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 32%),
    radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.16), transparent 30%),
    rgba(15, 23, 42, 0.92);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.12),
    0 22px 60px rgba(14, 165, 233, 0.12);
}

.module-card--reports::after {
  content: "Novo";
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #67e8f9;
  background: rgba(8, 47, 73, 0.75);
  border: 1px solid rgba(103, 232, 249, 0.35);
  border-radius: 999px;
  padding: 4px 8px;
}

.module-card--reports:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.22),
    0 28px 80px rgba(14, 165, 233, 0.22);
}

/* Cores por módulo */

.module-cadastros {
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.45), transparent 55%),
    rgba(15, 23, 42, 0.98);
}

.module-compras {
  background: radial-gradient(circle at top left, rgba(16, 185, 129, 0.45), transparent 55%),
    rgba(15, 23, 42, 0.98);
}

.module-vendas {
  background: radial-gradient(circle at top left, rgba(251, 191, 36, 0.45), transparent 55%),
    rgba(15, 23, 42, 0.98);
}

.module-analises {
  background: radial-gradient(circle at top left, rgba(147, 51, 234, 0.45), transparent 55%),
    rgba(15, 23, 42, 0.98);
}

.module-precificacao {
  background: radial-gradient(circle at top left, rgba(45, 212, 191, 0.5), transparent 55%),
    rgba(15, 23, 42, 0.98);
}

.module-rentabilidade {
  background: radial-gradient(circle at top left, rgba(248, 113, 113, 0.5), transparent 55%),
    rgba(15, 23, 42, 0.98);
}

.module-despesas {
  background: radial-gradient(
      circle at top left,
      rgba(199, 158, 112, 0.55),
      transparent 60%
    ),
    linear-gradient(135deg, #0f172a, #111827);
}

.module-sped {
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.28), transparent 52%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.22), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(8, 47, 73, 0.92));
  border-color: rgba(56, 189, 248, 0.30);
}

.module-sped::after {
  content: "Fiscal";
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4ade80;
  background: rgba(6, 78, 59, 0.65);
  border: 1px solid rgba(74, 222, 128, 0.30);
  border-radius: 999px;
  padding: 4px 8px;
}

.module-sped:hover {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.12),
    0 18px 45px rgba(14, 165, 233, 0.12);
}


/* ===== Cadastros > Clientes / Empresas ===== */

.cad-clientes-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
  gap: 1.25rem;
  align-items: flex-start;
}

@media (max-width: 960px) {
  .cad-clientes-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cad-clientes-lista {
  min-height: 260px;
}

.cad-clientes-form {
  min-height: 260px;
}

.card-header-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.card-subtitle {
  font-size: 0.8rem;
  color: #9ca3af;
}

.table-wrapper {
  margin-top: 0.25rem;
  max-height: 420px;
  overflow: auto;
}

/* tabela básica */
.table-basic {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.table-basic thead tr {
  background: rgba(15, 23, 42, 0.9);
}

.table-basic th,
.table-basic td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
  text-align: left;
}

.table-basic th {
  font-weight: 500;
  color: #9ca3af;
  font-size: 0.78rem;
}

.table-basic tbody tr:hover {
  background: rgba(15, 23, 42, 0.9);
}

/* formulário nova empresa */

.empresa-form {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* GRID ALINHADO PARA O FORM NOVA EMPRESA */
.empresa-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.2rem;
  row-gap: 0.9rem;
}

@media (max-width: 900px) {
  .empresa-form-grid {
    grid-template-columns: 1fr; /* empilha no mobile */
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-size: 0.78rem;
  color: #9ca3af;
}

.form-group input,
.form-group select {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.85);
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  color: #e5e7eb;
  transition: all 0.15s ease;
  outline: none;
}

.form-group input::placeholder {
  color: #4b5563;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #4f46e5;
  background: #020617;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
  outline: none;
}

.cad-clientes-form .form-group input:focus,
.cad-clientes-form .form-group select:focus {
  border-color: #3b82f6;
  background: #020617;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
  outline: none;
}

/* opções do select em modo dark – mais legíveis */
.form-group select option {
  background: #020617;      /* fundo bem escuro */
  color: #e5e7eb;           /* texto claro */
}

/* opção "Selecione" com tom mais fraco */
.form-group select option[value=""] {
  color: #9ca3af;
}


.empresa-form-actions {
  display: flex;
  justify-content: flex-end;
}

.form-error {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.6rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.7);
  color: #fecaca;
  font-size: 0.78rem;
}

.form-section-divider {
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  margin: 1.25rem 0 0.9rem;
}

.form-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0 0 0.2rem;
}

.form-hint {
  font-size: 0.72rem;
  color: #6b7280;
  margin: 0 0 0.75rem;
}

/* badge Admin no topo */

.pill-badge-admin {
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(52, 211, 153, 0.7);
  background: rgba(6, 78, 59, 0.6);
  font-size: 0.75rem;
  color: #a7f3d0;
}

.cad-clientes-header {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.btn-secondary.btn-sm {
  font-size: 0.78rem;
  padding: 0.25rem 0.7rem;
}

.link-table {
  color: #bfdbfe;
  text-decoration: none;
}

.link-table:hover {
  text-decoration: underline;
}
/* ===== Cadastros > Usuários da empresa ===== */

.cad-usuarios-form .form-group input,
.cad-usuarios-form .form-group select {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.95);
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  color: #e5e7eb;
  transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cad-usuarios-form .form-group input::placeholder {
  color: #6b7280;
}

/* destaque quando selecionado */
.cad-usuarios-form .form-group input:focus,
.cad-usuarios-form .form-group select:focus {
  border-color: #38bdf8;       /* ciano */
  background: #020617;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
  outline: none;
}

/* opções do select em dark mode */
.cad-usuarios-form .form-group select option {
  background: #020617;
  color: #e5e7eb;
}
/* ===== Botão Voltar (seta) ===== */

.back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e5e7eb;
  font-size: 1.25rem;
  text-decoration: none;
  margin-right: 0.9rem;
  transition: all 0.18s ease;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.55);
  transform: translateX(-2px);
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ── Seletor de empresa ativa (topbar) ───────────────────────────────────── */

.empresa-seletor {
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
}

.empresa-seletor__select {
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(79, 70, 229, 0.12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23bfdbfe'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  border: 1px solid rgba(79, 70, 229, 0.35);
  border-radius: 999px;
  color: #bfdbfe;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.25rem 1.8rem 0.25rem 0.8rem;
  cursor: pointer;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.empresa-seletor__select:hover {
  border-color: rgba(79, 70, 229, 0.65);
  background-color: rgba(79, 70, 229, 0.22);
}

.empresa-seletor__select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.45);
}

.empresa-seletor__select option {
  background: #0f172a;
  color: #e5e7eb;
}

.empresa-seletor__chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.10);
  border: 1px solid rgba(79, 70, 229, 0.25);
  color: #bfdbfe;
  font-size: 0.78rem;
  font-weight: 500;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Autofill dark override (webkit) ===== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #0f172a inset !important;
  -webkit-text-fill-color: #e5e7eb !important;
  caret-color: #e5e7eb !important;
  transition: background-color 9999s ease !important;
}

/* ===== Campo senha com toggle de visibilidade ===== */
.password-field {
  position: relative;
}

.password-field input {
  padding-right: 2.75rem;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #4b5563;
  padding: 0.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.password-toggle:hover {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.08);
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.6);
  outline-offset: 2px;
}

.password-toggle .eye-closed { display: none; }
.password-toggle.active .eye-open  { display: none; }
.password-toggle.active .eye-closed { display: block; }

/* ── Login · Radar de Rentabilidade — brand badge ───────────────────────── */

.login-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #818cf8;
  margin-bottom: 1.25rem;
  background: rgba(79, 70, 229, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
  animation: dotPulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25); }
  50%       { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.08); }
}

/* pill variante primária (indigo) */
.pill-primary {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.55);
  color: #a5b4fc;
}

/* ── Login · KPI cards animados ─────────────────────────────────────────── */

.login-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1.75rem;
}

.login-kpi-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.login-kpi-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(79, 70, 229, 0.05);
}

.login-kpi-card--wide {
  grid-column: 1 / -1;
}

.login-kpi-label {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ── Login · Mini gráfico SVG animado ───────────────────────────────────── */

.login-chart-wrap {
  margin-top: 1.5rem;
}

.login-chart {
  width: 100%;
  height: 56px;
  display: block;
  overflow: visible;
}

.chart-area {
  fill: url(#chartGrad);
  opacity: 0;
  animation: fadeChartArea 0.8s ease-out 1.6s forwards;
}

.chart-line {
  stroke: #6366f1;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 280;
  stroke-dashoffset: 280;
  animation: drawChart 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

.chart-label-up {
  font-size: 0.68rem;
  color: #4ade80;
  margin-top: 0.4rem;
  text-align: right;
  opacity: 0;
  transform: translateY(4px);
  animation: fadeChartLabel 0.4s ease-out 2s forwards;
}

@keyframes drawChart {
  to { stroke-dashoffset: 0; }
}

@keyframes fadeChartArea {
  to { opacity: 1; }
}

@keyframes fadeChartLabel {
  to { opacity: 0.7; transform: translateY(0); }
}
