/* Certipeso - Sistema de gerenciamento de Certificados e processos */
/* Estilos customizados para o dashboard */

:root {
  --certipeso-primary: #2c3e50;
  --certipeso-secondary: #34495e;
  --certipeso-success: #27ae60;
  --certipeso-warning: #f39c12;
  --certipeso-danger: #e74c3c;
  --certipeso-info: #3498db;
  --certipeso-light: #ecf0f1;
  --certipeso-dark: #2c3e50;
}

/* Header customizado */
.certipeso-header {
  background: linear-gradient(135deg, var(--certipeso-primary), var(--certipeso-secondary));
  color: white;
  padding: 1rem 0;
}

/* Cards de estatísticas */
.certipeso-stat-card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.certipeso-stat-card:hover {
  transform: translateY(-2px);
}

.certipeso-stat-card .card-body {
  padding: 1.5rem;
}

.certipeso-stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--certipeso-primary);
}

.certipeso-stat-label {
  color: #6c757d;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Páginas compactas: título perto do cabeçalho, cards com sombra (sem borda) */
body:has(.page-compact) main.content {
  padding-top: 0.5rem;
}

.page-compact > .page-title,
.page-compact .page-title {
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.page-compact .card {
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 10px;
}

.page-compact .card-header {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.page-compact .table {
  font-size: 0.875rem;
}

.page-compact .table > :not(caption) > * > * {
  padding: 0.4rem 0.6rem;
}

/* Cards de estatísticas: compactos, sombra, sem traço de borda */
.dashboard-stat-cards .card {
  min-height: 0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: none;
}
.dashboard-stat-cards .card-body {
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.85rem;
}
.dashboard-stat-cards .card-title {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.dashboard-stat-cards .card h1,
.dashboard-stat-cards .stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 0.15rem;
  margin-bottom: 0;
  line-height: 1.25;
}
.dashboard-stat-cards .card .mb-0,
.dashboard-stat-cards .stat-meta {
  margin-bottom: 0;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: #6c757d;
}
.dashboard-stat-cards .stat {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dashboard-stat-cards .stat i {
  width: 18px;
  height: 18px;
}

/* Dashboard - linha do gráfico e calendário/tabela */
.content .container-fluid .row.mb-3 + .row .card {
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.content .container-fluid .row .col-xl-5 .card,
.content .container-fluid .row .col-xl-7 .card {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.content .container-fluid .row .col-xl-5 .card-body,
.content .container-fluid .row .col-xl-7 .card-body {
  flex: 1;
  min-height: 0;
}

/* Gráficos customizados */
.certipeso-chart-container {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Tabelas customizadas */
.certipeso-table {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.certipeso-table thead th {
  background-color: var(--certipeso-primary);
  color: white;
  border: none;
  font-weight: 600;
}

/* Botões customizados */
.btn-certipeso-primary {
  background-color: var(--certipeso-primary);
  border-color: var(--certipeso-primary);
  color: white;
}

.btn-certipeso-primary:hover {
  background-color: var(--certipeso-secondary);
  border-color: var(--certipeso-secondary);
  color: white;
}

/*
 * Sidebar fixa — só transform (não margin-left).
 * AdminKit (dashboard.css) em ≤991.98px inverte .collapsed (= aberto via margin).
 * Aqui .collapsed = sempre escondido; no mobile abre com .show.
 */
#sidebar.sidebar,
.sidebar.js-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  z-index: 1040;
  margin-left: 0 !important;
  transform: translateX(0);
  transition: transform .3s ease;
}

/* Conteúdo principal reserva o espaço do sidebar fixo */
.wrapper > .main {
  margin-left: 260px;
  transition: margin-left .3s ease;
}

.wrapper > .main.sidebar-collapsed {
  margin-left: 0;
}

/* Desktop: collapsed = escondido */
#sidebar.sidebar.collapsed,
.sidebar.js-sidebar.collapsed {
  margin-left: 0 !important;
  transform: translateX(-100%) !important;
}

/* Sidebar customizada */
.certipeso-sidebar,
.certlog-sidebar {
  background: linear-gradient(180deg, var(--certipeso-primary), var(--certipeso-secondary));
}

.certipeso-sidebar .sidebar-nav .sidebar-item .sidebar-link {
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

.certipeso-sidebar .sidebar-nav .sidebar-item .sidebar-link:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

/* CORREÇÕES PARA DROPDOWNS DA NAVBAR */
.navbar-nav .nav-item.dropdown {
  position: relative;
}

.navbar-nav .nav-item.dropdown .nav-icon,
.navbar-nav .nav-item.dropdown .nav-link {
  cursor: pointer !important;
  position: relative;
  z-index: 1000;
}

.navbar-nav .nav-item.dropdown .dropdown-toggle {
  cursor: pointer !important;
  pointer-events: auto !important;
}

.navbar-nav .nav-item.dropdown .dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

/* Garantir que os dropdowns apareçam */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  float: left;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin: 0.125rem 0 0;
  font-size: 1rem;
  color: #212529;
  text-align: left;
  list-style: none;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
}

.dropdown-menu.show {
  display: block !important;
}

/* Posicionamento específico para dropdowns da navbar */
.navbar-nav .dropdown-menu {
  right: 0;
  left: auto;
}

/* Indicadores de notificação */
.nav-icon .position-relative .indicator {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--certipeso-danger);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Hover effects para dropdowns */
.navbar-nav .nav-item.dropdown:hover .dropdown-menu {
  display: block;
}

/* Correção para ícones SVG */
.nav-icon svg.feather {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Correção para avatar */
.navbar-nav .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* Sidebar toggle essencial */
.sidebar-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  color: #6c757d;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
  position: relative;
  z-index: 1000;
  pointer-events: auto;
}

.sidebar-toggle:hover {
  color: #495057;
  background-color: #f8f9fa;
  text-decoration: none;
}

.sidebar-toggle .hamburger {
  width: 24px;
  height: 3px;
  position: relative;
  display: block;
  background-color: #495057;
}

.sidebar-toggle .hamburger::before {
  content: '';
  position: absolute;
  top: -7.5px;
  width: 24px;
  height: 3px;
  background-color: #495057;
}

.sidebar-toggle .hamburger::after {
  content: '';
  position: absolute;
  bottom: -7.5px;
  width: 16px;
  height: 3px;
  background-color: #495057;
}

.certipeso-sidebar .sidebar-nav .sidebar-item.active .sidebar-link {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Navbar fixa ao rolar (sidebar UX) - z-index abaixo do overlay (1035) e sidebar (1040) */
.navbar-sticky {
  position: sticky;
  top: 0;
  z-index: 1020;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Garantir que botão do sidebar-toggle não herde estilos indesejados */
button.sidebar-toggle {
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
  pointer-events: none;
}

/* Mobile/tablet: mesmo breakpoint do AdminKit (991.98px) */
@media (max-width: 991.98px) {
  .certipeso-stat-number {
    font-size: 1.5rem;
  }
  
  .certipeso-chart-container {
    padding: 1rem;
  }
  
  .navbar-sticky {
    z-index: 1020;
  }

  /* Anula AdminKit (escondido via margin / collapsed = aberto) */
  #sidebar.sidebar,
  .sidebar.js-sidebar,
  #sidebar.sidebar.collapsed,
  .sidebar.js-sidebar.collapsed {
    margin-left: 0 !important;
    transform: translateX(-100%);
    z-index: 1040;
  }

  #sidebar.sidebar.show,
  .sidebar.js-sidebar.show {
    transform: translateX(0);
    margin-left: 0 !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }

  .wrapper > .main,
  .wrapper > .main.sidebar-collapsed {
    margin-left: 0 !important;
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

/* Área rolável nativa (sem SimpleBar — evita faixa vazia / menus invisíveis) */
#sidebar .sidebar-content,
.sidebar .sidebar-content {
  position: relative;
  top: auto;
  left: auto;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar .sidebar-content::-webkit-scrollbar {
  display: none;
}

.sidebar .sidebar-content .sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
}

/* Paginação customizada */
.pagination {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.pagination .page-item {
  margin: 0;
}

.pagination .page-link {
  border: 1px solid #dee2e6;
  color: var(--certipeso-primary);
  background-color: white;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 2.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.pagination .page-link:hover {
  background-color: var(--certipeso-light);
  border-color: var(--certipeso-primary);
  color: var(--certipeso-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination .page-item.active .page-link {
  background-color: var(--certipeso-primary);
  border-color: var(--certipeso-primary);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pagination .page-item.disabled .page-link {
  color: #6c757d;
  background-color: #f8f9fa;
  border-color: #dee2e6;
  cursor: not-allowed;
  opacity: 0.6;
}

.pagination .page-item.disabled .page-link:hover {
  transform: none;
  box-shadow: none;
}

/* Estilo para ellipsis */
.pagination .page-item.disabled .page-link:not([disabled]) {
  background-color: transparent;
  border-color: transparent;
  color: #6c757d;
  cursor: default;
}

/* Garantir que a paginação seja horizontal */
.pagination-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.pagination-container nav {
  display: flex;
  align-items: center;
}

.pagination-container ul {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

/* Responsividade para paginação */
@media (max-width: 768px) {
  .pagination {
    gap: 0.125rem;
  }
  
  .pagination .page-link {
    padding: 0.375rem 0.5rem;
    min-width: 2rem;
    font-size: 0.8rem;
  }
  
  .pagination-container {
    justify-content: center;
  }
} 