/* ================================================================
   AssinaLegal.css — Folha de estilos unificada
   Versão: 2.0 — Pacote Unificado (Login + Menu + Dashboard + Documentos)

   ÍNDICE DE SEÇÕES
   ──────────────────────────────────────────────────────────────
   1.  VARIÁVEIS E TEMA            → cores, tamanhos, sombras
   2.  RESET E BASE                → normalize, body, scrollbar
   3.  LAYOUT PRINCIPAL            → app-layout, sidebar, topbar, main
   4.  NAVEGAÇÃO — SIDEBAR         → itens, grupos, badge, rodapé
   5.  TOPBAR — BARRA SUPERIOR     → título, ações, avatar, tema
   6.  BOTÕES                      → todos os .btn e variações
   7.  FORMULÁRIOS                 → inputs, selects, labels, rows
   8.  CARDS                       → card, card-header, card-body
   9.  TABELAS                     → table-wrap, thead, tbody, células
   10. BADGES                      → pílulas de status coloridas
   11. WIZARD DE PASSOS            → indicador de progresso modal
   12. UPLOAD / FILE DROP          → drop zone e estados
   13. MODAL                       → overlay, header, body, footer
   14. ALERTAS INLINE              → success, warning, danger, info
   15. TOAST NOTIFICATIONS         → notificações temporárias
   16. DASHBOARD — COMPONENTES     → stats, acesso rápido, progresso
   17. DETALHE DE CAMPOS           → detail-grid, field-label/value
   18. TELA DE LOGIN               → layout, painel visual, formulário
   19. ANIMAÇÕES                   → fadeIn, slideIn, modalIn
   20. RESPONSIVO                  → breakpoints 900px / 768px / 640px
   ──────────────────────────────────────────────────────────────
   Uso: adicionar UMA única tag <link> no _Layout.cshtml.
   Fontes necessárias (Google Fonts + Font Awesome no _Layout.cshtml):
     <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
   ================================================================ */


/* ════════════════════════════════════════════════════════════════
   1. VARIÁVEIS E TEMA
   Para alternar dark mode: adicionar data-theme="dark" no <html>.
   Via JS: document.documentElement.setAttribute('data-theme','dark')
   ════════════════════════════════════════════════════════════════ */
:root {
  /* — Cores da marca — */
  --primary:           #1d4ed8;
  --primary-dark:      #1e40af;
  --primary-light:     #3b82f6;
  --primary-glow:      rgba(29, 78, 216, 0.15);

  /* — Cores semânticas — */
  --success:           #059669;
  --success-bg:        #d1fae5;
  --warning:           #d97706;
  --warning-bg:        #fef3c7;
  --danger:            #dc2626;
  --danger-bg:         #fee2e2;

  /* — Superfícies (tema claro) — */
  --bg:                #f1f5f9;
  --surface:           #ffffff;
  --surface2:          #f8fafc;
  --input-bg:          #ffffff;

  /* — Sidebar — */
  --sidebar-bg:        #0f2040;
  --sidebar-text:      #cbd5e1;
  --sidebar-border:    rgba(255, 255, 255, 0.06);

  /* — Topbar — */
  --topbar-bg:         #ffffff;

  /* — Gradiente da tela de login — */
  --gradient-start:    #0f2040;
  --gradient-mid:      #1d4ed8;
  --gradient-end:      #0ea5e9;

  /* — Texto (tema claro) — */
  --text:              #0f172a;
  --text-muted:        #64748b;
  --text-light:        #94a3b8;

  /* — Bordas e sombras — */
  --border:            #e2e8f0;
  --shadow:            0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:         0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-input:      0 0 0 3px rgba(29, 78, 216, 0.18);

  /* — Dimensões fixas — */
  --sidebar-w:         260px;
  --topbar-h:          64px;

  /* — Bordas arredondadas — */
  --radius-sm:         6px;
  --radius:            10px;
  --radius-lg:         16px;
  --radius-xl:         24px;

  /* — Transição padrão — */
  --transition:        .2s ease;

  /* — Wizard — */
  --wizard-done:       #059669;
  --wizard-active:     var(--primary);
  --wizard-line:       #dde2ee;

  /* — Upload — */
  --upload-border:     #dde2ee;

  /* — Toast — */
  --toast-min-w:       280px;
  --toast-max-w:       360px;
  --toast-radius:      10px;
}

/* Tema escuro — substitui apenas as variáveis que mudam */
[data-theme="dark"] {
  --bg:                #0a0f1e;
  --surface:           #111827;
  --surface2:          #1a2235;
  --input-bg:          #1a2235;
  --sidebar-bg:        #070d1a;
  --topbar-bg:         #111827;
  --text:              #f1f5f9;
  --text-muted:        #94a3b8;
  --text-light:        #64748b;
  --border:            #1e293b;
  --shadow:            0 1px 3px rgba(0,0,0,.3);
  --shadow-md:         0 4px 6px rgba(0,0,0,.3);
  --success-bg:        rgba(5, 150, 105, .15);
  --warning-bg:        rgba(217, 119, 6, .15);
  --danger-bg:         rgba(220, 38, 38, .15);
  --wizard-line:       #1e2d45;
  --upload-border:     #1e2d45;
}


/* ════════════════════════════════════════════════════════════════
   2. RESET E BASE
   ════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
}

a    { text-decoration: none; color: inherit; }
button { font-family: 'Inter', sans-serif; cursor: pointer; border: none; outline: none; }
input, select, textarea { font-family: 'Inter', sans-serif; }

::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }


/* ════════════════════════════════════════════════════════════════
   3. LAYOUT PRINCIPAL
   Estrutura de três camadas: sidebar fixa + topbar fixa + conteúdo.
   A tela de login usa .login-page (ver Seção 18) e NÃO usa .app-layout.
   ════════════════════════════════════════════════════════════════ */
.app-layout {
  display: block;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar — drawer vertical fixo à esquerda */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  transition: width var(--transition), transform var(--transition);
}

/* Topbar — barra horizontal fixa no topo */
.topbar {
  position: fixed;
  left: var(--sidebar-w);
  right: 0; top: 0;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 99;
  transition: left var(--transition), background var(--transition);
}

/* Área de conteúdo — empurrada pela sidebar e topbar */
/*.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overflow-x: hidden;
  transition: margin-left var(--transition);
}
*/
.main-content {
    margin-left: 0;
    margin-top: 0;
    padding: 0;
    height: auto;
    overflow: visible;
}


/* ════════════════════════════════════════════════════════════════
   4. NAVEGAÇÃO — SIDEBAR
   ════════════════════════════════════════════════════════════════ */

/* Cabeçalho: logo + nome do sistema */
.sidebar-header {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 36px; height: 36px;
  background: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 28px; height: 28px;
  object-fit: contain;
}

.sidebar-brand {
  color: #ffffff;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-brand span {
  display: block;
  font-size: .7rem;
  font-weight: 400;
  opacity: .45;
  margin-top: 2px;
}

/* Área de navegação — rolável */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

/* Rótulo de grupo de seção (PRINCIPAL, CADASTROS…) */
.nav-section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .3);
  padding: 12px 10px 6px;
}

/* Item de menu */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
  position: relative;
  user-select: none;
  text-decoration: none;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .07);
  color: #ffffff;
}

/* Item ativo — fundo azul translúcido + barra lateral */
.nav-item.active,
.nav-item:global(.active) {
  background: var(--primary-glow);
  color: #ffffff;
}

.nav-item.active::before,
.nav-item:global(.active)::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--primary-light);
  border-radius: 0 3px 3px 0;
}

/* Badge de notificação dentro do item de menu */
.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #ffffff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* Rodapé da sidebar — usuário logado */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, .07);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  color: #ffffff;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: rgba(255, 255, 255, .4);
  font-size: .7rem;
  margin-top: 1px;
}

/* Avatar — círculo com iniciais. Usado na sidebar e topbar. */
.avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
  user-select: none;
}

.avatar.sm {
  width: 34px; height: 34px;
  font-size: .75rem;
}


/* ════════════════════════════════════════════════════════════════
   5. TOPBAR — BARRA SUPERIOR
   ════════════════════════════════════════════════════════════════ */

/* Botão hambúrguer — visível somente em mobile */
.topbar-menu-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1.5px solid var(--border);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Título e subtítulo da página atual */
.topbar-title {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-subtitle {
  display: block;
  font-size: .75rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Grupo de ações à direita */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Botão ícone genérico (notificação, ajuda…) */
.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .95rem;
  transition: all var(--transition);
  position: relative;
}

.icon-btn:hover {
  background: var(--border);
  color: var(--text);
}

/* Ponto vermelho de notificação não lida */
.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--topbar-bg);
}

/* Botão de alternar tema claro/escuro */
.theme-toggle-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .95rem;
  transition: all var(--transition);
}

.theme-toggle-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* Usuário logado na extrema direita */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.topbar-user:hover { background: var(--surface2); }

.topbar-user-name {
  font-weight: 600;
  font-size: .875rem;
  color: var(--text);
}

.topbar-user-role {
  font-size: .75rem;
  color: var(--text-muted);
}


/* ════════════════════════════════════════════════════════════════
   6. BOTÕES
   Classe base: .btn
   Variações de cor: .btn-primary / .btn-secondary / .btn-ghost /
                     .btn-danger / .btn-success / .btn-warning
   Variações de tamanho: .btn-sm / .btn-lg
   Variações de forma: .btn-icon (quadrado) / .btn-block (largura total)
   ════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  text-decoration: none;
}

/* Primário — azul */
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(29, 78, 216, .35);
}

/* Secundário — neutro com borda */
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

/* Ghost — transparente */
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

/* Danger — vermelho */
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, .2);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

/* Success — verde */
.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(5, 150, 105, .2);
}
.btn-success:hover { background: var(--success); color: #fff; }

/* Warning — amarelo/laranja */
.btn-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(217, 119, 6, .2);
}
.btn-warning:hover { background: var(--warning); color: #fff; }

/* Tamanhos */
.btn-sm  { padding: 7px 14px; font-size: .8rem; }
.btn-lg  { padding: 13px 28px; font-size: 1rem; }

/* Formas */
.btn-icon  { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; justify-content: center; }


/* ════════════════════════════════════════════════════════════════
   7. FORMULÁRIOS
   ════════════════════════════════════════════════════════════════ */

/* Grupo campo: label + input */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Input / select / textarea padrão */
.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .95rem;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-input);
}

.form-control::placeholder { color: var(--text-light); }

/* Input com ícone sobreposto à esquerda */
.input-icon-wrap { position: relative; }

.input-icon-wrap .form-control { padding-left: 42px; }

.input-icon-wrap .icon-left {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.input-icon-wrap .icon-right {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  cursor: pointer;
  transition: color var(--transition);
}

.input-icon-wrap .icon-right:hover { color: var(--primary); }

/* Barra de filtros — linha acima da tabela */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Campo de busca com ícone à esquerda */
.search-box {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.search-box input {
  padding-left: 36px;
  width: 100%;
}

.search-box i {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .9rem;
  pointer-events: none;
}

/* Select de filtro — versão compacta do .form-control */
.filter-select {
  padding: 9px 12px;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: .875rem;
  cursor: pointer;
  transition: border-color var(--transition);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Input de data — largura fixa para não crescer demais */
.date-input {
  max-width: 148px;
  flex-shrink: 0;
}

/* Linhas de formulário em colunas
   .form-row        → 2 colunas
   .form-row.three  → 3 colunas  */
.form-row       { display: grid; grid-template-columns: 1fr 1fr;       gap: 14px; }
.form-row.three { display: grid; grid-template-columns: 1fr 1fr 1fr;   gap: 14px; }

/* Contador de caracteres de textarea */
.char-counter {
  text-align: right;
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.char-counter.near-limit {
  color: var(--warning);
  font-weight: 600;
}

/* Divisor "ou" — usado na tela de login */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-light);
  font-size: .8rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}


/* ════════════════════════════════════════════════════════════════
   8. CARDS
   Componente base reutilizado em toda a aplicação.
   ════════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title    { font-size: 1rem; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

.card-body { padding: 20px; }

.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}


/* ════════════════════════════════════════════════════════════════
   9. TABELAS
   Sempre envolva em .table-wrap para scroll horizontal em mobile.
   ════════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  background: var(--surface2);
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover      { background: var(--surface2); }

tbody td {
  padding: 12px 14px;
  font-size: .875rem;
  vertical-align: middle;
}

/* Linha de célula com nome principal + subtítulo */
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub   { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

/* Colunas especiais da tabela de Documentos */
.table-check-col { width: 36px; text-align: center; }

/* Código do documento — azul clicável */
.doc-codigo {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  cursor: pointer;
  transition: opacity .15s;
}

.doc-codigo:hover { opacity: .7; }

/* Coluna T.E (envio de e-mail) — ícone centralizado */
.te-col { width: 40px; text-align: center; }

/* Data de cancelamento — vermelha quando preenchida */
td.data-cancel:not(:empty) {
  color: var(--danger);
  font-weight: 600;
}

/* Grupo de botões de ação na última coluna */
.doc-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}


/* ════════════════════════════════════════════════════════════════
   10. BADGES DE STATUS
   Pílulas coloridas para situação de documentos, planos, etc.
   Uso: <span class="badge badge-green"><span class="badge-dot"></span> Assinado</span>
   ════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* Ponto colorido dentro do badge */
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-blue   { background: rgba(29,78,216,.12); color: var(--primary);   }
.badge-green  { background: var(--success-bg);   color: var(--success);   }
.badge-orange { background: var(--warning-bg);   color: var(--warning);   }
.badge-red    { background: var(--danger-bg);    color: var(--danger);    }
.badge-gray   { background: var(--surface2);     color: var(--text-muted); border: 1px solid var(--border); }


/* ════════════════════════════════════════════════════════════════
   11. WIZARD DE PASSOS
   Indicador de progresso no topo do modal Novo Documento.
   Estados: padrão → .active (atual) → .done (concluído)
   ════════════════════════════════════════════════════════════════ */
.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Círculo numerado */
.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  border: 2px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  transition: all .25s ease;
  flex-shrink: 0;
}

.step-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color .2s ease;
}

/* Estado ativo */
.step.active .step-circle {
  background: var(--wizard-active);
  border-color: var(--wizard-active);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(29, 78, 216, .15);
}

.step.active .step-label { color: var(--primary); font-weight: 700; }

/* Estado concluído */
.step.done .step-circle {
  background: var(--wizard-done);
  border-color: var(--wizard-done);
  color: #fff;
}

.step.done .step-label { color: var(--wizard-done); }

/* Linha conectora entre passos */
.step-line {
  flex: 1;
  height: 2px;
  background: var(--wizard-line);
  min-width: 20px;
  margin: 0 4px;
  align-self: flex-start;
  margin-top: 15px;
  transition: background .3s ease;
}

.step-line.done { background: var(--wizard-done); }


/* ════════════════════════════════════════════════════════════════
   12. UPLOAD / FILE DROP
   Drop zone clicável para seleção de PDF.
   O <InputFile> do Blazor fica oculto e é acionado via JS Interop.
   Estados: padrão → .dragover (durante drag) → .has-file (selecionado)
   ════════════════════════════════════════════════════════════════ */
.file-drop {
  border: 2px dashed var(--upload-border);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.file-drop:hover,
.file-drop.dragover {
  border-color: var(--primary);
  background: rgba(29, 78, 216, .04);
}

.file-drop-icon {
  font-size: 2.2rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 10px;
}

.file-drop-title {
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: 4px;
  color: var(--text);
}

.file-drop-hint {
  font-size: .8rem;
  color: var(--text-muted);
}

/* Estado: arquivo selecionado */
.file-drop.has-file {
  border-color: var(--wizard-done);
  background: rgba(5, 150, 105, .04);
}

.file-drop.has-file .file-drop-icon { color: var(--wizard-done); }

/* Pílula com nome do arquivo selecionado */
.file-name-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .8rem;
  margin-top: 10px;
  color: var(--text);
}

.file-name-chip i { color: var(--danger); }


/* ════════════════════════════════════════════════════════════════
   13. MODAL
   Estrutura: .modal-overlay > .modal > .modal-header + .modal-body + .modal-footer
   Visível quando .open é adicionado ao .modal-overlay.
   No Blazor: use @if (modalAberto) para renderizar o overlay com .open.
   .modal-lg → modal maior (680px) para wizards e formulários complexos.
   ════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn .2s ease;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .25);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-lg { max-width: 680px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title i { color: var(--primary); }

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-bg);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  flex-shrink: 0;
}


/* ════════════════════════════════════════════════════════════════
   14. ALERTAS INLINE
   Banners de feedback exibidos dentro de cards ou do modal.
   Uso: <div class="alert alert-success"><i class="fas fa-check-circle"></i> Texto</div>
   ════════════════════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .875rem;
  line-height: 1.5;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert i { margin-top: 1px; flex-shrink: 0; }

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(5, 150, 105, .25);
}

.alert-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: rgba(217, 119, 6, .25);
}

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(220, 38, 38, .25);
}

.alert-info {
  background: rgba(29, 78, 216, .08);
  color: var(--primary);
  border-color: rgba(29, 78, 216, .2);
}


/* ════════════════════════════════════════════════════════════════
   15. TOAST NOTIFICATIONS
   Notificações temporárias no canto inferior direito.
   No Blazor: use ToastService + ToastContainer.razor (ver guia).
   ════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--toast-radius);
  padding: 14px 18px;
  min-width: var(--toast-min-w);
  max-width: var(--toast-max-w);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
  animation: slideIn .3s ease forwards;
  pointer-events: all;
  border-left: 3px solid transparent;
}

.toast-icon { font-size: 1.1rem; margin-top: 1px; flex-shrink: 0; }

.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }

.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-error { border-left-color: var(--danger); }
.toast-error .toast-icon { color: var(--danger); }

.toast-info { border-left-color: var(--primary); }
.toast-info .toast-icon { color: var(--primary); }

.toast-content { flex: 1; }
.toast-title   { font-weight: 700; font-size: .875rem; margin-bottom: 2px; color: var(--text); }
.toast-msg     { font-size: .8rem; color: var(--text-muted); line-height: 1.4; }

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .8rem;
  padding: 0;
  flex-shrink: 0;
  transition: color .15s;
}

.toast-close:hover { color: var(--text); }

.toast.removing { animation: slideOut .3s ease forwards; }


/* ════════════════════════════════════════════════════════════════
   16. DASHBOARD — COMPONENTES
   Componentes específicos da tela de Dashboard.
   ════════════════════════════════════════════════════════════════ */

/* Cabeçalho de página — reutilizado em todas as telas internas */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.page-header p {
  color: var(--text-muted);
  font-size: .875rem;
  margin-top: 3px;
}

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

/* Grid de cards de estatística */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* 200px */
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 10px; /* 20px */
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: box-shadow var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.blue   { background: rgba(29,78,216,.1); color: var(--primary);  }
.stat-icon.green  { background: var(--success-bg);  color: var(--success);  }
.stat-icon.orange { background: var(--warning-bg);  color: var(--warning);  }
.stat-icon.red    { background: var(--danger-bg);   color: var(--danger);   }

.stat-info  { flex: 1; }
.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }

.stat-change {
  font-size: .75rem;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger);  }
.stat-change.flat { color: var(--text-muted); }

/* Grid principal do Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}

/* Acesso rápido — ícones de atalho */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.quick-item {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  text-decoration: none;
}

.quick-item:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-item i    { font-size: 1.6rem; color: var(--primary); }
.quick-item span { font-size: .75rem; font-weight: 600; color: var(--text-muted); }
.quick-item:hover span { color: var(--primary); }

/* Barra de progresso — consumo do plano */
.progress-wrap {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}

.progress-bar-track {
  background: var(--border);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

/* Largura definida inline: style="width: 60%" */
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #0ea5e9);
  border-radius: 3px;
  transition: width 0.5s ease;
}


/* ════════════════════════════════════════════════════════════════
   17. DETALHE DE CAMPOS
   Grade de rótulo + valor para revisão (Step 4) e detalhes.
   Uso: <div class="detail-grid"> → <div class="detail-field"> → field-label / field-value
   ════════════════════════════════════════════════════════════════ */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.field-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.field-value {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}


/* ════════════════════════════════════════════════════════════════
   18. TELA DE LOGIN
   Layout exclusivo da página de login.
   Não usa .app-layout nem .sidebar — é uma tela separada.
   ════════════════════════════════════════════════════════════════ */

/* Corpo da tela de login — desativa overflow:hidden do body */
body.login-body { overflow: auto; }

/* Layout: painel visual (esq.) + formulário (dir.) */
.login-page {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

/* Painel esquerdo — gradiente e branding */
.login-left {
  flex: 1;
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 60%, var(--gradient-end) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

/* Padrão decorativo de fundo */
.login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.login-brand {
  position: relative;
  text-align: center;
  color: #ffffff;
}

.login-brand .logo-circle {
  width: 90px; height: 90px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
}

.login-brand .logo-circle img {
  width: 70px; height: 70px;
  object-fit: contain;
}

.login-brand h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.login-brand p {
  font-size: 1rem;
  opacity: .8;
  max-width: 360px;
  line-height: 1.6;
}

/* Lista de features abaixo do logo */
.login-features {
  margin-top: 48px;
  position: relative;
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 380px;
}

.login-feature {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
  backdrop-filter: blur(8px);
}

.login-feature i    { font-size: 1.3rem; opacity: .9; width: 24px; text-align: center; }
.login-feature span { font-size: .875rem; opacity: .85; }

/* Painel direito — formulário */
.login-right {
  width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 50px;
  background: var(--surface);
  position: relative;
  transition: background var(--transition);
}

.login-form-card { width: 100%; }

.login-form-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.login-form-card .subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: .9rem;
}

/* Rodapé do formulário */
.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: .85rem;
  color: var(--text-muted);
}

.login-footer a         { color: var(--primary); font-weight: 500; }
.login-footer a:hover   { text-decoration: underline; }

.login-legal {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  color: var(--text-light);
  text-align: center;
}

.login-legal a { color: var(--primary); }


/* ════════════════════════════════════════════════════════════════
   19. ANIMAÇÕES
   ════════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateX(calc(100% + 24px)); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(calc(100% + 24px)); opacity: 0; }
}

@keyframes modalIn {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-overlay.open .modal { animation: modalIn .25s ease; }


/* ════════════════════════════════════════════════════════════════
   20. RESPONSIVO
   ════════════════════════════════════════════════════════════════ */

/* 900px — sidebar vira drawer, topbar ocupa toda a largura */
@media (max-width: 900px) {
  .sidebar            { transform: translateX(-100%); }
  .sidebar.open       { transform: translateX(0); }
  .topbar             { left: 0; }
  .topbar-menu-btn    { display: flex; }
  .main-content       { margin-left: 0; }
  .dashboard-grid     { grid-template-columns: 1fr; }
}

/* 768px — tela de login: oculta painel visual */
@media (max-width: 768px) {
  .login-left  { display: none; }
  .login-right { width: 100%; padding: 40px 28px; }
}

/* 640px — filtros, formulários, modal e toasts em mobile */
@media (max-width: 640px) {
  .filter-bar     { flex-direction: column; align-items: stretch; }
  .search-box     { min-width: 0; }
  .date-input     { max-width: 100%; }

  .form-row,
  .form-row.three { grid-template-columns: 1fr; }

  .detail-grid    { grid-template-columns: 1fr 1fr; }

  .modal-overlay  { padding: 0; align-items: flex-end; }
  .modal          { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; }

  #toast-container { bottom: 0; right: 0; left: 0; padding: 0 12px 12px; }
  .toast           { min-width: 0; max-width: 100%; }
}
