/* ─── e-Fisco Consultant — Design Tokens ─────────────────────────────────────
 * Base: Bootstrap 5 (mantido intacto)
 * Este arquivo sobrescreve variáveis visuais e adiciona tokens proprietários.
 * ─────────────────────────────────────────────────────────────────────────── */

/* Importar Inter do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Tokens globais (CSS custom properties) ──────────────────────────────── */
:root {
  /* Bootstrap overrides */
  --bs-primary:              #1A5EA8;
  --bs-primary-rgb:          26, 94, 168;
  --bs-border-radius:        8px;
  --bs-border-radius-sm:     6px;
  --bs-border-radius-lg:     10px;
  --bs-border-radius-xl:     12px;
  --bs-body-font-family:     'Inter', sans-serif;
  --bs-body-bg:              #F8FAFC;
  --bs-body-color:           #0F172A;
  --bs-card-border-color:    #E2E8F0;

  /* Tokens proprietários */
  --ef-primary:              #1A5EA8;
  --ef-primary-hover:        #154d8e;
  --ef-primary-light:        #EBF2FF;
  --ef-text:                 #0F172A;
  --ef-text-muted:           #64748B;
  --ef-bg:                   #F8FAFC;
  --ef-surface:              #FFFFFF;
  --ef-border:               #E2E8F0;

  --ef-sidebar-bg:           #0F2D5E;
  --ef-sidebar-text:         rgba(255, 255, 255, 0.85);
  --ef-sidebar-text-active:  #FFFFFF;
  --ef-sidebar-hover-bg:     rgba(255, 255, 255, 0.08);
  --ef-sidebar-active-bg:    rgba(255, 255, 255, 0.15);

  --ef-card-radius:          10px;
  --ef-btn-radius:           8px;
  --ef-input-radius:         8px;
  --ef-shadow-card:          0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --ef-shadow-card-hover:    0 4px 12px rgba(0, 0, 0, 0.10);
  --ef-shadow-dropdown:      0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ── Tipografia ──────────────────────────────────────────────────────────── */
body {
  font-family: var(--bs-body-font-family);
  background-color: var(--ef-bg);
  color: var(--ef-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--ef-text);
}

/* ── Bootstrap Primary ───────────────────────────────────────────────────── */
.bg-primary          { background-color: var(--ef-primary) !important; }
.text-primary        { color: var(--ef-primary) !important; }
.border-primary      { border-color: var(--ef-primary) !important; }

.btn-primary {
  background-color: var(--ef-primary);
  border-color:     var(--ef-primary);
  border-radius:    var(--ef-btn-radius);
  font-weight:      500;
  transition:       background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--ef-primary-hover);
  border-color:     var(--ef-primary-hover);
  box-shadow:       0 0 0 3px rgba(26, 94, 168, 0.25);
}

.btn-outline-primary {
  color:         var(--ef-primary);
  border-color:  var(--ef-primary);
  border-radius: var(--ef-btn-radius);
  font-weight:   500;
}
.btn-outline-primary:hover {
  background-color: var(--ef-primary);
  border-color:     var(--ef-primary);
}

/* ── Botões genéricos ────────────────────────────────────────────────────── */
.btn {
  border-radius: var(--ef-btn-radius);
  font-weight:   500;
}

/* ── Inputs / Forms ──────────────────────────────────────────────────────── */
.form-control,
.form-select {
  border-radius:  var(--ef-input-radius);
  border-color:   var(--ef-border);
  color:          var(--ef-text);
  transition:     border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--ef-primary);
  box-shadow:   0 0 0 3px rgba(26, 94, 168, 0.18);
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  border-radius: var(--ef-card-radius);
  border-color:  var(--ef-card-border-color, var(--ef-border));
  box-shadow:    var(--ef-shadow-card);
  background:    var(--ef-surface);
}
.card:hover {
  box-shadow: var(--ef-shadow-card-hover);
  transition: box-shadow 0.2s ease;
}
.card-header {
  border-bottom-color: var(--ef-border);
  font-weight: 600;
}

/* ── Navbar (topo azul institucional) ────────────────────────────────────── */
.navbar.bg-primary {
  background-color: var(--ef-primary) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
}
.navbar .nav-link {
  font-weight: 500;
  opacity: 0.88;
  border-radius: 6px;
  transition: opacity 0.15s;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.12);
}

/* ── Tabelas ─────────────────────────────────────────────────────────────── */
.table {
  color: var(--ef-text);
}
.table thead.table-dark th {
  background-color: #1E3A5F;
  border-color:     #2A4A72;
  font-weight:      600;
  font-size:        0.8125rem;
  letter-spacing:   0.03em;
  text-transform:   uppercase;
}
.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(248, 250, 252, 0.6);
}
.table-hover > tbody > tr:hover > * {
  background-color: var(--ef-primary-light);
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  border-radius: 6px;
  font-weight:   500;
}

/* ── Alertas ─────────────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--ef-card-radius);
  border-left-width: 4px;
}

/* ── Dropdown ────────────────────────────────────────────────────────────── */
.dropdown-menu {
  border-radius: var(--ef-card-radius);
  border-color:  var(--ef-border);
  box-shadow:    var(--ef-shadow-dropdown);
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-content {
  border-radius: var(--ef-card-radius);
  border-color:  var(--ef-border);
  box-shadow:    var(--ef-shadow-dropdown);
}
.modal-header {
  border-bottom-color: var(--ef-border);
}
.modal-footer {
  border-top-color: var(--ef-border);
}

/* ── Utilitários de espaçamento e refinamento ────────────────────────────── */
.container-fluid.mt-4 {
  padding-left:  1.5rem;
  padding-right: 1.5rem;
}

/* KPI cards (seção Fase 3) */
#section-kpi .card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#section-kpi .card:hover {
  transform:  translateY(-2px);
  box-shadow: var(--ef-shadow-card-hover);
}

/* ── Sidebar Layout ──────────────────────────────────────────────────────── */

/* Topbar mobile */
.ef-topbar {
  background-color: var(--ef-sidebar-bg);
  padding: 0.625rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.ef-topbar-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
  cursor: pointer;
}
.ef-topbar-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  margin-left: 0.75rem;
}

/* Sidebar base (compartilhado desktop + offcanvas) */
.ef-sidebar {
  background-color: var(--ef-sidebar-bg) !important;
  width: 260px !important;
  display: flex;
  flex-direction: column;
}

/* Desktop: sidebar fixa à esquerda */
@media (min-width: 992px) {
  .ef-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 1030;
    overflow-y: auto;
    overflow-x: hidden;
    /* Garante que o Bootstrap não oculte o elemento */
    visibility: visible !important;
    transform: none !important;
  }
  .ef-main-content {
    margin-left: 260px;
  }
}

/* Conteúdo principal */
.ef-main-content {
  padding: 1.5rem;
  min-height: 100vh;
}

/* Marca no topo da sidebar (desktop) */
.ef-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 1.25rem 1.125rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.ef-sidebar-brand i {
  font-size: 1.4rem;
}

/* Nav links */
.ef-sidebar-nav {
  padding: 0.75rem 0.625rem;
  overflow-y: auto;
}
.ef-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5625rem 0.875rem;
  margin-bottom: 2px;
  color: var(--ef-sidebar-text);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.14s, color 0.14s;
}
.ef-nav-link i {
  font-size: 1.1rem;
  flex-shrink: 0;
  opacity: 0.85;
}
.ef-nav-link:hover {
  background-color: var(--ef-sidebar-hover-bg);
  color: var(--ef-sidebar-text-active);
}
.ef-nav-link:hover i {
  opacity: 1;
}
.ef-nav-link.active {
  background-color: var(--ef-sidebar-active-bg);
  color: var(--ef-sidebar-text-active);
  font-weight: 600;
}
.ef-nav-link.active i {
  opacity: 1;
}

/* Rodapé da sidebar: usuário + logout */
.ef-sidebar-footer {
  padding: 0.875rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.ef-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ef-sidebar-text);
  margin-bottom: 0.5rem;
}
.ef-user-info i {
  font-size: 1.2rem;
}
.ef-username {
  font-size: 0.85rem;
  font-weight: 500;
}
.ef-logout-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.14s, color 0.14s;
}
.ef-logout-link:hover {
  background-color: var(--ef-sidebar-hover-bg);
  color: #fff;
}
.ef-logout-link i {
  font-size: 1rem;
}

/* Remove padding padrão do offcanvas-body quando em mobile */
.ef-sidebar .offcanvas-body {
  padding: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   Dashboard Moderno — cards de estatística e KPIs financeiros
   ═══════════════════════════════════════════════════════════════════ */

/* ── Cores soft (fundos de ícones) ── */
.bg-primary-soft   { background-color: rgba(26, 94, 168, 0.12) !important; }
.bg-success-soft   { background-color: rgba(40, 167, 69, 0.12) !important; }
.bg-danger-soft    { background-color: rgba(220, 53, 69, 0.12) !important; }
.bg-warning-soft   { background-color: rgba(255, 193, 7, 0.15) !important; }
.bg-info-soft      { background-color: rgba(23, 162, 184, 0.12) !important; }
.bg-secondary-soft { background-color: rgba(108, 117, 125, 0.12) !important; }

/* ── Cards de indicadores operacionais ── */
.dash-stat-card {
  border-radius: var(--ef-card-radius, 10px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.10) !important;
}
.dash-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: .9rem;
  flex-shrink: 0;
}

/* ── Cards de KPI financeiro ── */
.kpi-card {
  border-radius: var(--ef-card-radius, 10px);
  border-left: 4px solid transparent !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12) !important;
}
.kpi-card--blue   { border-left-color: #1A5EA8 !important; }
.kpi-card--red    { border-left-color: #dc3545 !important; }
.kpi-card--orange { border-left-color: #fd7e14 !important; }
.kpi-card--purple { border-left-color: #6f42c1 !important; }

.kpi-value {
  font-size: 1.45rem;
  letter-spacing: -.01em;
  color: #1a1a2e;
}

.kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.kpi-icon--blue   { background: rgba(26, 94, 168, 0.12); color: #1A5EA8; }
.kpi-icon--red    { background: rgba(220, 53, 69, 0.12);  color: #dc3545; }
.kpi-icon--orange { background: rgba(253, 126, 20, 0.12); color: #fd7e14; }
.kpi-icon--purple { background: rgba(111, 66, 193, 0.12); color: #6f42c1; }

/* ═══════════════════════════════════════════════════════════════════
   Telas de Listagem Modernas (Empresas · Consultas · Fronteira)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Card de filtros ── */
.list-filter-card {
  border-radius: var(--ef-card-radius, 10px);
  background: #f8f9fc;
}
.list-filter-card .form-select,
.list-filter-card .form-control {
  background-color: #fff;
  font-size: .825rem;
}
.list-filter-card .form-label {
  letter-spacing: .02em;
}

/* ── Tabela moderna ── */
.list-table {
  font-size: .83rem;
  border-collapse: separate;
  border-spacing: 0;
}
.list-table-head th {
  background: var(--ef-sidebar-bg, #0F2D5E);
  color: #fff;
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .65rem .85rem;
  border: none;
  white-space: nowrap;
}
.list-table-head th:first-child  { border-radius: 0; }
.list-table-head th:last-child   { border-radius: 0; }
.list-table tbody tr {
  border-bottom: 1px solid #f0f2f7;
  transition: background-color 0.12s ease;
}
.list-table tbody tr:last-child  { border-bottom: none; }
.list-table tbody tr:nth-child(odd)  { background-color: #fafbfd; }
.list-table tbody tr:nth-child(even) { background-color: #fff; }
.list-table tbody tr:hover {
  background-color: #eef3fb !important;
}
.list-table td {
  padding: .55rem .85rem;
  vertical-align: middle;
  border: none;
}
/* Linha sem dados */
.list-table tbody tr td[colspan] {
  background: #fff !important;
  color: #8a93a2;
}

/* ── Badges de status (e-Fisco) ── */
.badge-regular {
  background: rgba(25, 135, 84, .12);
  color: #146c43;
  border: 1px solid rgba(25, 135, 84, .25);
  font-size: .72rem;
  font-weight: 600;
  padding: .28em .65em;
  border-radius: 20px;
}
.badge-irregular {
  background: rgba(220, 53, 69, .1);
  color: #b02a37;
  border: 1px solid rgba(220, 53, 69, .25);
  font-size: .72rem;
  font-weight: 600;
  padding: .28em .65em;
  border-radius: 20px;
}
.badge-erro {
  background: rgba(255, 193, 7, .15);
  color: #856404;
  border: 1px solid rgba(255, 193, 7, .35);
  font-size: .72rem;
  font-weight: 600;
  padding: .28em .65em;
  border-radius: 20px;
}
.badge-timeout {
  background: rgba(108, 117, 125, .12);
  color: #495057;
  border: 1px solid rgba(108, 117, 125, .25);
  font-size: .72rem;
  font-weight: 600;
  padding: .28em .65em;
  border-radius: 20px;
}
.badge-pendente {
  background: rgba(108, 117, 125, .08);
  color: #6c757d;
  border: 1px solid rgba(108, 117, 125, .2);
  font-size: .72rem;
  font-weight: 600;
  padding: .28em .65em;
  border-radius: 20px;
}
.badge-indeterminado {
  background: rgba(13, 110, 253, .08);
  color: #0a58ca;
  border: 1px solid rgba(13, 110, 253, .2);
  font-size: .72rem;
  font-weight: 600;
  padding: .28em .65em;
  border-radius: 20px;
}

/* ── Badges Fronteira ── */
.badge-fronteira-com {
  background: rgba(25, 135, 84, .12);
  color: #146c43;
  border: 1px solid rgba(25, 135, 84, .25);
  font-size: .72rem;
  font-weight: 600;
  padding: .28em .65em;
  border-radius: 20px;
}
.badge-fronteira-sem {
  background: rgba(108, 117, 125, .1);
  color: #495057;
  border: 1px solid rgba(108, 117, 125, .25);
  font-size: .72rem;
  font-weight: 600;
  padding: .28em .65em;
  border-radius: 20px;
}
.badge-fronteira-erro {
  background: rgba(220, 53, 69, .1);
  color: #b02a37;
  border: 1px solid rgba(220, 53, 69, .25);
  font-size: .72rem;
  font-weight: 600;
  padding: .28em .65em;
  border-radius: 20px;
}

/* ── Botões inline pequenos ── */
.btn-action {
  padding: .2rem .5rem;
  font-size: .75rem;
  border-radius: 6px;
  line-height: 1.4;
}
.list-table .btn { font-size: .75rem; padding: .2rem .45rem; }

/* ═══════════════════════════════════════════════════════════════════
   Upload de Certificado — Drag & Drop Zone
   ═══════════════════════════════════════════════════════════════════ */
.pfx-drop-zone {
  border: 2px dashed #c7d0e0;
  border-radius: 10px;
  background: #f8f9fc;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.pfx-drop-zone:hover,
.pfx-drop-zone--over {
  border-color: var(--ef-primary, #1A5EA8);
  background: #eef3fb;
}
.pfx-drop-zone--ok {
  border-color: #198754;
  background: #f0faf4;
  border-style: solid;
}
.pfx-drop-icon {
  font-size: 2rem;
  color: #adb5bd;
  margin-bottom: .5rem;
}
.pfx-drop-zone--ok .pfx-drop-icon { color: #198754; }
.pfx-drop-zone--over .pfx-drop-icon { color: var(--ef-primary, #1A5EA8); }

/* ═══════════════════════════════════════════════════════════════════
   Notificações — Toggle rows
   ═══════════════════════════════════════════════════════════════════ */
.notif-toggle-row {
  background: #f8f9fc;
  border: 1px solid #eaecf3;
  transition: background 0.12s;
}
.notif-toggle-row:hover { background: #eef3fb; }
.notif-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Toggle switch — maior e com cor primária */
.notif-switch {
  width: 2.75em !important;
  height: 1.5em !important;
  cursor: pointer;
}
.notif-switch:checked {
  background-color: var(--ef-primary, #1A5EA8) !important;
  border-color: var(--ef-primary, #1A5EA8) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   Certificados — badge de alerta vencimento
   ═══════════════════════════════════════════════════════════════════ */
.badge-cert-vencendo {
  background: rgba(220, 53, 69, .1);
  color: #b02a37;
  border: 1px solid rgba(220, 53, 69, .3);
  font-size: .72rem;
  font-weight: 600;
  padding: .28em .65em;
  border-radius: 20px;
}
.badge-cert-valido {
  background: rgba(25, 135, 84, .1);
  color: #146c43;
  border: 1px solid rgba(25, 135, 84, .25);
  font-size: .72rem;
  font-weight: 600;
  padding: .28em .65em;
  border-radius: 20px;
}
.badge-cert-vencido {
  background: rgba(108, 117, 125, .1);
  color: #495057;
  border: 1px solid rgba(108, 117, 125, .25);
  font-size: .72rem;
  font-weight: 600;
  padding: .28em .65em;
  border-radius: 20px;
}

/* ── Headers com fundo azul escuro — texto sempre branco ─────────────────── */
.card-header {
  color: #ffffff !important;
}

.card-header .card-title,
.card-header h5,
.card-header h6,
.card-header span,
.card-header a,
.card-header small {
  color: #ffffff !important;
}

/* Badge/pill dentro de header escuro */
.card-header .badge {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

/* Ícones dentro de headers escuros */
.card-header i,
.card-header svg {
  color: rgba(255, 255, 255, 0.85) !important;
}
