@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&family=Poppins:wght@400;500&family=Roboto+Mono:wght@400&display=swap');

:root {
  /* Paleta de Cores */
  --primary: #D62828; /* Vermelho escuro */
  --primary-hover: #B71C1C;
  --secondary: #264653; /* Azul profundo */
  --accent: #F6AA1C; /* Amarelo dourado */
  --success: #4CAF50; /* Verde suave */
  --bg-light: #E9ECEF; /* Cinza claro */
  --white: #FFFFFF;
  --text-main: #1A1A2E;
  --text-muted: #6C757D;
  
  /* Fontes */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Poppins', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  
  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 60px;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--bg-light);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .brand-text {
  font-family: var(--font-heading);
  font-weight: 700;
}

.subheading, label, .fw-500 {
  font-weight: 500;
}

.data-number, .stat-value {
  font-family: var(--font-mono);
}

.brand-logo {
  height: 2rem;
  width: 2rem;
  object-fit: contain;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
  padding: 3px;
}

.sidebar-logo {
  height: 1.8rem;
  width: 1.8rem;
  object-fit: contain;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
  padding: 2px;
}

.auth-logo-img {
  height: 90px;
  width: 90px;
  object-fit: contain;
  display: block;
  margin: 0 auto 20px auto;
  border-radius: 16px;
  background: rgba(255,255,255,0.15);
  padding: 10px;
}

.auth-logo-card {
  height: 60px;
  width: 60px;
  object-fit: contain;
  display: block;
  margin: 0 auto 12px auto;
  border-radius: 12px;
  background: rgba(38,70,83,0.08);
  padding: 8px;
}

/* Loader Base (Páginas Pesadas) */
#page-loader {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--white);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transition: opacity 0.5s ease;
}

.spinner-logo {
  font-size: 3rem;
  color: var(--primary);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Botões */
.btn-primary-custom {
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-primary-custom:hover {
  background-color: var(--primary-hover);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(214, 40, 40, 0.3);
}

.btn-secondary-custom {
  background-color: transparent;
  color: var(--secondary);
  border: 1px solid var(--secondary);
  border-radius: 6px;
  padding: 10px 20px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-secondary-custom:hover {
  background-color: var(--bg-light);
  color: var(--secondary);
}

.btn-success-custom {
  background-color: var(--success);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-success-custom:hover {
  opacity: 0.9;
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

/* Auth Layout (Login / Password) */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
}

.auth-panel-left {
  background-color: var(--secondary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  color: var(--white);
  width: 50%;
  position: relative;
  overflow: hidden;
}

.auth-panel-right {
  width: 50%;
  background-color: var(--white);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.auth-card {
  width: 100%;
  max-width: 450px;
}

.auth-map-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: radial-gradient(circle at center, rgba(214,40,40,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.auth-logo-icon {
  font-size: 5rem;
  color: var(--accent);
  margin-bottom: 20px;
}

.auth-title {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--secondary);
}

.auth-subtitle {
  color: var(--text-muted);
  margin-bottom: 30px;
  font-size: 0.9rem;
}

/* Inputs Globais */
.form-control, .form-select {
  border: 1px solid #CED4DA;
  border-radius: 8px;
  padding: 12px 15px;
  transition: all 0.3s ease;
  color: var(--text-main);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(214, 40, 40, 0.25);
}

.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper i {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-icon-wrapper .form-control {
  padding-left: 45px;
}

.input-group-text.password-toggle {
  cursor: pointer;
  background: transparent;
  border-left: none;
  color: var(--text-muted);
}

.input-icon-wrapper .form-control.password-input {
  border-right: none;
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--primary-hover);
}

/* Separator */
.divider-or {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  margin: 20px 0;
}

.divider-or::before, .divider-or::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #CED4DA;
}

.divider-or span {
  padding: 0 10px;
  font-size: 0.9rem;
}

.floating-label label {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
}

/* Responsive Auth */
@media (max-width: 991px) {
  .auth-wrapper { flex-direction: column; }
  .auth-panel-left, .auth-panel-right { width: 100%; }
  .auth-panel-left { min-height: 30vh; padding: 30px; }
  .auth-logo-icon { font-size: 4rem; margin-bottom: 10px; }
}

/* Animações UI */
.fade-in {
  animation: fadeIn 0.8s ease-in-out;
}

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

/* Customização Toastr */
#toast-container > div {
  opacity: 0.95;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-family: var(--font-body);
}

#toast-container > .toast-success { background-color: var(--success); }
#toast-container > .toast-error { background-color: var(--primary); }
#toast-container > .toast-warning { background-color: var(--accent); color: var(--text-main); }
#toast-container > .toast-info { background-color: var(--secondary); }

/* Layout Autenticado - Dashboard */
.wrapper {
  display: flex;
  width: 100%;
  align-items: stretch;
}

/* Sidebar */
#sidebar {
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  background: var(--secondary);
  color: var(--white);
  transition: all 0.3s;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#sidebar.active {
  margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
  padding: 20px;
  background: rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-header i { color: var(--accent); font-size: 1.5rem; flex-shrink: 0; }
.sidebar-header img { flex-shrink: 0; }
.sidebar-header h3 { margin: 0; font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.components {
  padding: 20px 0;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.components::-webkit-scrollbar { width: 4px; }
.components::-webkit-scrollbar-track { background: transparent; }
.components::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }

.components p {
  padding: 10px 20px;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

#sidebar ul li a {
  padding: 12px 20px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 15px;
  color: rgba(255,255,255,0.8);
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

#sidebar ul li a i { width: 20px; text-align: center; }

#sidebar ul li a:hover, #sidebar ul li.active > a {
  color: var(--white);
  background: rgba(255,255,255,0.1);
  border-left-color: var(--primary);
}

.sidebar-footer {
  padding: 15px 20px;
  background: rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-footer img {
  width: 35px; height: 35px; border-radius: 50%;
  border: 2px solid var(--accent);
}

.sidebar-footer .user-info h6 { margin: 0; font-size: 0.9rem; }
.sidebar-footer .user-info small { color: rgba(255,255,255,0.6); font-size: 0.75rem; }

/* Page Content */
#content {
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  transition: all 0.3s;
  position: absolute;
  top: 0;
  right: 0;
  background: var(--bg-light);
}

#sidebar.active ~ #content {
  width: 100%;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background: var(--white);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 900;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

#sidebarCollapse {
  background: transparent; border: none; font-size: 1.2rem; color: var(--secondary); cursor: pointer;
}

.page-title { margin: 0; font-size: 1.25rem; font-weight: 600; color: var(--secondary); }

.topbar-right-actions i { font-size: 1.2rem; color: var(--secondary); cursor: pointer; }
.notification-badge { position: relative; }
.notification-badge::after {
  content: ''; position: absolute; top: 0; right: -2px; width: 8px; height: 8px;
  background: var(--primary); border-radius: 50%; border: 2px solid var(--white);
}

/* Área de Conteúdo Central */
.main-container {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Cards de Estatísticas */
.stat-card {
  background: #FFF;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 24px;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.stat-info p { margin: 0; font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }
.stat-info h3 { margin: 5px 0 0; font-size: 1.8rem; font-family: var(--font-mono); color: var(--secondary); }

.stat-icon {
  width: 50px; height: 50px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.primary { background: rgba(214,40,40,0.1); color: var(--primary); }
.stat-icon.secondary { background: rgba(38,70,83,0.1); color: var(--secondary); }
.stat-icon.success { background: rgba(76,175,80,0.1); color: var(--success); }
.stat-icon.warning { background: rgba(246,170,28,0.1); color: var(--accent); }

/* Badges */
.badge-custom {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-active { background: rgba(76,175,80,0.15); color: var(--success); }
.badge-inactive { background: rgba(214,40,40,0.15); color: var(--primary); }
.badge-pending { background: rgba(246,170,28,0.2); color: #B97A00; }

/* Content Cards Genéricos */
.content-card {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  margin-bottom: 24px;
}

.card-header-styled {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--bg-light);
}

.card-title { margin: 0; font-size: 1.1rem; color: var(--secondary); }

/* Tabelas */
.table-custom { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-custom th {
  background: var(--secondary); color: var(--white);
  padding: 12px 15px; font-weight: 500; font-size: 0.9rem;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.table-custom th:first-child { border-top-left-radius: 8px; }
.table-custom th:last-child { border-top-right-radius: 8px; }

.table-custom td {
  padding: 15px; border-bottom: 1px solid var(--bg-light);
  font-size: 0.9rem; vertical-align: middle;
}
.table-custom tbody tr:nth-child(even) { background-color: #F8F9FA; }
.table-custom tbody tr:hover { background-color: rgba(246,170,28,0.05); }

/* Action Buttons na Tabela */
.btn-action {
  width: 30px; height: 30px; border-radius: 6px; border: none; display: inline-flex;
  align-items: center; justify-content: center; margin: 0 3px; cursor: pointer; transition: all 0.2s;
}
.btn-view { background: rgba(38,70,83,0.1); color: var(--secondary); }
.btn-edit { background: rgba(246,170,28,0.1); color: #B97A00; }
.btn-delete { background: rgba(214,40,40,0.1); color: var(--primary); }
.btn-action:hover { transform: scale(1.1); }

/* Paginação */
.pagination-custom { display: flex; list-style: none; padding: 0; gap: 5px; margin-top: 20px; justify-content: flex-end;}
.page-item .page-link {
  border: 1px solid var(--bg-light); border-radius: 6px; color: var(--secondary);
  padding: 8px 12px; transition: all 0.2s;
}
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: var(--white); }
.page-item .page-link:hover:not(.active) { background: var(--bg-light); }

/* Separador de seção */
.section-divider {
  height: 2px;
  background-color: var(--accent);
  width: 50px;
  margin: 15px auto;
  border-radius: 2px;
}

/* Responsive Dashboard Layout */
@media (max-width: 768px) {
  #sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
  }
  #sidebar.active {
    margin-left: 0;
  }
  #content {
    width: 100%;
  }
  #sidebar.active ~ #content {
    pointer-events: none; /* Previne clique no conteúdo quando sidebar overlay estiver visível */
    filter: blur(2px) brightness(0.8);
  }
  #sidebarCollapse { display: block; }
}

/* landing page specifics */
.hero-section {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--secondary) 0%, #1A3A4A 100%);
  display: flex; flex-direction: column; position: relative;
  overflow: hidden;
}
.landing-navbar { padding: 20px 50px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.hero-content { flex: 1; display: flex; align-items: center; padding: 0 50px; }
.scroll-indicator {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  color: var(--white); font-size: 2rem; animation: bounce 2s infinite; opacity: 0.7;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
  40% { transform: translateY(-15px) translateX(-50%); }
  60% { transform: translateY(-7px) translateX(-50%); }
}
