/* css/base.css */
/* v1.3 - Ajustes de estilo globais */
/* v1.2 - Adiciona estilos para notificações Toast */
/* v1.1 - Fix Rendering Glitches (Ghost Scrollbars/Blocks) */

/* Lucide Icons Base Style */
.lucide {
  font-family: "LucideIcons"; /* Fallback if needed */
  width: 1.1em;
  height: 1.1em;
  stroke-width: 2;
  display: inline-block;
  line-height: 1;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* Combined Dark Theme Variables — nyvvo brand */
:root {
  --body-bg: #050d1c;
  --card-bg: rgba(8, 16, 34, 0.94);
  --input-bg: rgba(10, 22, 44, 0.92);
  --card-border: rgba(255,255,255,0.08);
  --text-primary: #e8f0ff;
  --text-secondary: #8ba3c9;
  --text-heading: #ffffff;
  --sidebar-bg: #060c18;
  --sidebar-text: #8ba3c9;
  --sidebar-icon-color: #8ba3c9;

  /* Cores de Ação/Destaque — nyvvo: verde → teal → azul */
  --sidebar-active-bg: #2edb7f;
  --sidebar-active-text: #ffffff;
  --sidebar-active-icon-color: #ffffff;
  --accent-color: #2edb7f;
  --accent-color-darker: #00c8d4;
  --accent-color-hover: #3b82f6;
  --accent-text-color: #030c1a;

  /* Botões */
  --btn-primary-bg: #2edb7f;
  --btn-primary-border: #2edb7f;
  --btn-primary-text: #030c1a;
  --btn-primary-hover-bg: #00c8d4;
  --btn-primary-hover-border: #00c8d4;
  --btn-danger-bg: #dc3545;
  --btn-danger-border: #dc3545;
  --btn-danger-text: #ffffff;
  --btn-danger-hover-bg: #c82333;
  --btn-danger-hover-border: #bd2130;

  /* Inputs */
  --input-border: rgba(255,255,255,0.12);
  --input-text: var(--text-primary);
  --input-focus-border: var(--accent-color);
  --input-focus-shadow: 0 0 0 0.2rem rgba(46, 219, 127, 0.22);
  --text-error: #f87171;
  --border-error: #f87171;

  /* Gráficos */
  --chart-grid-color: rgba(255,255,255,0.08);
  --chart-text-color: var(--text-secondary);
  --chart-text-primary-color: var(--text-primary);

  /* Resultados e Status */
  --result-correct-text: #2edb7f;
  --result-incorrect-text: #f87171;
  --result-blank-text: #8ba3c9;
  --neon-orange: #ffab40;
  --neon-orange-glow1: #ffab40;
  --neon-orange-glow2: #ff9f40;
  --neon-orange-glow3: #e65100;
  --status-approved-text: #2edb7f;
  --status-reproved-text: #f87171;

  /* Específicos dos Módulos */
  --mapa-accent-color: var(--accent-color);
  --mapa-accent-color-darker: var(--accent-color-darker);
  --mapa-input-focus-border: var(--input-focus-border);
  --mapa-input-focus-shadow: var(--input-focus-shadow);
  --mapa-text-accent: var(--accent-color);
  --card-border-rgb: 255, 255, 255;
}

:root.theme-light {
  --body-bg: #f6f8fb;
  --card-bg: #ffffff;
  --input-bg: #f1f5f9;
  --card-border: #e2e8f0;
  --text-primary: #1f2933;
  --text-secondary: #47505f;
  --text-heading: #0f172a;
  --sidebar-bg: #ffffff;
  --sidebar-text: #4b5563;
  --sidebar-icon-color: #6b7280;
  --sidebar-active-bg: #60a5fa;
  --sidebar-active-text: #0f172a;
  --sidebar-active-icon-color: #0f172a;
  --accent-color: #3b82f6;
  --accent-color-darker: #2563eb;
  --accent-color-hover: #22d3ee;
  --accent-text-color: #0b1727;
  --btn-primary-bg: #3b82f6;
  --btn-primary-border: #3b82f6;
  --btn-primary-text: #ffffff;
  --btn-primary-hover-bg: #2563eb;
  --btn-primary-hover-border: #2563eb;
  --btn-danger-bg: #dc3545;
  --btn-danger-border: #dc3545;
  --btn-danger-text: #ffffff;
  --btn-danger-hover-bg: #c82333;
  --btn-danger-hover-border: #bd2130;
  --input-border: #cbd5e1;
  --input-text: #0f172a;
  --input-focus-border: #3b82f6;
  --input-focus-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
  --text-error: #b91c1c;
  --border-error: #b91c1c;
  --chart-grid-color: #d1d5db;
  --chart-text-color: #47505f;
  --chart-text-primary-color: #1f2933;
  --mapa-accent-color: var(--accent-color);
  --mapa-accent-color-darker: var(--accent-color-darker);
  --mapa-input-focus-border: var(--input-focus-border);
  --mapa-input-focus-shadow: var(--input-focus-shadow);
  --mapa-text-accent: var(--accent-color);
  --card-border-rgb: 226, 232, 240;
}

/* Logo e Branding */
.sidebar-brand-container {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    radial-gradient(circle at 0% 0%, rgba(46, 219, 127, 0.1), transparent 10rem);
  overflow: hidden;
  transition: all 0.3s ease;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(42, 252, 131, 0.15), rgba(79, 173, 255, 0.2));
  border: 1px solid rgba(42, 252, 131, 0.3);
  box-shadow: 0 0 14px rgba(42, 252, 131, 0.16);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.brand-icon .lucide {
  width: 20px;
  height: 20px;
  color: #2afc83;
  margin: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  flex: 1;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.brand-name {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.15rem 0.62rem 0.2rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-size: 1.02rem;
  font-weight: 900;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

#sidebar.collapsed .brand-info {
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
  width: 0;
}

#sidebar.collapsed .brand-icon {
  margin: 0 auto;
}

/* Layout Geral */
body {
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(46, 219, 127, 0.08), transparent 24rem),
    radial-gradient(circle at top right, rgba(0, 200, 212, 0.08), transparent 20rem),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.08), transparent 24rem),
    var(--body-bg);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

/* Sidebar Styles - Base (Expandida) */
#sidebar {
  width: 230px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 1rem 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #343a40;
  z-index: 10;
  transition: width 0.3s ease;
  position: relative;
  overflow-x: hidden;
}

#sidebar .profile-section {
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #343a40;
  transition: padding 0.3s ease, opacity 0.2s ease 0.1s;
}

#sidebar .profile-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #495057;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-text);
  flex-shrink: 0;
}

#sidebar .profile-name {
  color: #ffffff;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease 0.1s;
}

#sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#sidebar nav li a {
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0.95rem 1.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    padding 0.3s ease,
    transform 0.2s ease;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  border-radius: 10px;
}

#sidebar nav li a .lucide {
  color: var(--sidebar-icon-color);
  margin-right: 0.8rem;
  font-size: 1.2em;
  flex-shrink: 0;
  transition: margin 0.3s ease, color 0.2s ease, transform 0.2s ease;
}

#sidebar nav li a span:not(.lucide) {
  overflow: hidden;
  transition: opacity 0.2s ease 0.1s;
}

#sidebar nav li a:hover {
  background: linear-gradient(135deg, rgba(46, 219, 127, 0.1), rgba(0, 200, 212, 0.07));
  color: #e8f3ff;
  transform: translateX(2px);
}

#sidebar nav li a:hover .lucide {
  color: #e8f3ff;
  transform: translateX(2px);
}

#sidebar nav li.active a {
  background: linear-gradient(135deg, rgba(46, 219, 127, 0.12), rgba(0, 200, 212, 0.09));
  color: var(--sidebar-active-text);
  font-weight: 600;
  border-left-color: var(--sidebar-active-bg);
  box-shadow:
    inset 0 0 0 1px rgba(46, 219, 127, 0.14),
    0 6px 18px rgba(46, 219, 127, 0.12);
}

#sidebar nav li.active a .lucide {
  color: var(--sidebar-active-icon-color);
  transform: translateX(2px);
}

#sidebar .sidebar-bottom-links {
  margin-top: auto;
  padding: 1rem 0;
  border-top: 1px solid #343a40;
  overflow: hidden;
}

#sidebar .sidebar-bottom-links a {
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0.85rem 1.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, padding 0.3s ease;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}

#sidebar .sidebar-bottom-links span:not(.lucide) {
  overflow: hidden;
  transition: opacity 0.2s ease 0.1s;
}

#sidebar .sidebar-bottom-links a:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

#sidebar .sidebar-bottom-links a:hover .lucide {
  color: var(--text-primary);
}

/* Toggle de tema como switch */
.theme-switch {
  position: relative;
}
.theme-switch-track {
  position: relative;
  width: 40px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  padding: 2px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.theme-switch-thumb {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2edb7f, #00c8d4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transform: translateX(0);
  transition: transform 0.2s ease;
}
.theme-switch:hover .theme-switch-track {
  background: rgba(46, 219, 127, 0.18);
  border-color: rgba(46, 219, 127, 0.35);
}
.theme-switch.active .theme-switch-thumb {
  transform: translateX(20px);
}

/* Botão de Toggle da Sidebar */
#sidebar-toggle-btn {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--sidebar-text);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, right 0.3s ease;
  z-index: 15;
}

#sidebar-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

#sidebar-toggle-btn .lucide {
  width: 1.2em;
  height: 1.2em;
  margin: 0 !important;
}

/* === Sidebar Recolhida === */
#sidebar.sidebar-collapsed {
  width: 64px;
}

#sidebar.sidebar-collapsed .profile-section {
  padding: 1rem 0;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  height: 0;
  margin-bottom: 0;
  border-bottom: none;
  overflow: hidden;
}

#sidebar.sidebar-collapsed .profile-name {
  display: none !important;
}

#sidebar.sidebar-collapsed nav li a {
  justify-content: center;
  padding: 0.85rem 0;
  overflow: visible;
}

#sidebar.sidebar-collapsed nav li a .lucide {
  margin-right: 0;
  font-size: 1.4em;
}

/* Força o texto a desaparecer completamente */
#sidebar.sidebar-collapsed nav li a span:not(.lucide),
#sidebar.sidebar-collapsed .sidebar-bottom-links span:not(.lucide),
#sidebar.sidebar-collapsed .version-info {
  display: none !important;
}

#sidebar.sidebar-collapsed .sidebar-bottom-links a {
  justify-content: center;
  padding: 0.85rem 0;
  overflow: visible;
}

#sidebar.sidebar-collapsed #sidebar-toggle-btn {
  right: calc((60px - 36px) / 2);
}

/* =========================================== */

/* Main Content Styles */
main#main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
  transition: margin-left 0.3s ease;
  /* FIX: Cria um novo contexto de empilhamento para evitar vazamento de renderização */
  isolation: isolate;
}

.page-header {
  color: var(--text-heading);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  padding: 1.5rem 1.5rem 0 1.5rem;
  flex-shrink: 0;
}

.page-content {
  padding: 0 1.5rem 1.5rem 1.5rem;
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  /* FIX: Força o uso da GPU para renderização, evitando 'fantasmas' visuais ao rolar */
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Module Visibility */
.module-content.hidden {
  display: none;
}

/* Widget/Card Styling */
.widget-card {
  background: linear-gradient(180deg, rgba(13, 26, 50, 0.94), rgba(7, 15, 30, 0.98));
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  margin-bottom: 1.5rem;
  box-shadow:
    0 0 0 1px rgba(46, 219, 127, 0.04),
    0 18px 48px rgba(0, 0, 0, 0.28),
    0 0 48px rgba(37, 99, 235, 0.08);
  display: flex;
  flex-direction: column;
  /* FIX: Evita que elementos dentro do card 'sangrem' e causem bugs visuais */
  transform: translateZ(0); 
  position: relative;
  overflow: hidden;
}

.widget-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.widget-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.widget-title .lucide {
  color: var(--text-secondary);
  margin-right: 0.6rem;
}

.widget-body {
  padding: 1.25rem;
  flex-grow: 1;
}

.widget-footer {
  border-top: 1px solid var(--card-border);
  background-color: rgba(7, 15, 30, 0.82);
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
  padding: 0.75rem 1.25rem;
  text-align: right;
  flex-shrink: 0;
}

/* FIX: Estilo específico para containers com scroll dentro de widgets */
/* Corrige as barras cinzas flutuantes na tela */
.overflow-y-auto {
  transform: translateZ(0);
  will-change: scroll-position;
}

/* Input Styling */
.input-form,
input[type="text"],
input[type="date"],
input[type="number"],
input[type="url"],
select,
textarea {
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--input-text);
  padding: 0.6rem 0.8rem;
  border-radius: 0.8rem;
  width: 100%;
  box-shadow: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out,
    background-color 0.15s ease-in-out;
  font-size: 0.9rem;
}

input[type="date"] {
  color-scheme: dark;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: var(--input-focus-shadow);
  background-color: rgba(12, 28, 54, 0.98);
}

label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

fieldset {
  border: 1px solid var(--card-border);
  padding: 1rem;
  border-radius: 0.25rem;
}

legend {
  padding: 0 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Checkbox */
input[type="checkbox"] {
  height: 1rem;
  width: 1rem;
  border-radius: 0.25rem;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--accent-color);
  cursor: pointer;
  appearance: none;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
  vertical-align: middle;
}

input[type="checkbox"]:checked {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 4px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:focus {
  box-shadow: var(--input-focus-shadow);
  outline: none;
  border-color: var(--input-focus-border);
}

label.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 400;
  margin-bottom: 0;
  cursor: pointer;
}

.input-error {
  border-color: var(--border-error) !important;
}

::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

/* Buttons */
button {
  padding: 0.6rem 1.2rem;
  border-radius: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  font-size: 0.9rem;
  box-shadow: none;
  user-select: none;
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #2edb7f 0%, #00c8d4 55%, #3b82f6 100%);
  color: var(--btn-primary-text);
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.26), 0 0 32px rgba(46, 219, 127, 0.18);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #3b82f6 0%, #00c8d4 48%, #2edb7f 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34), 0 0 36px rgba(46, 219, 127, 0.22);
  transform: translateY(-2px);
}

.btn-primary:disabled {
  background: #495057;
  border: none;
  color: #adb5bd;
}

.btn-danger {
  background-color: var(--btn-danger-bg);
  color: var(--btn-danger-text);
  border-color: var(--btn-danger-border);
}
.btn-danger:hover:not(:disabled) {
  background-color: var(--btn-danger-hover-bg);
  border-color: var(--btn-danger-hover-border);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border: 1px solid var(--input-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-secondary:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-heading);
  border-color: var(--accent-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24), 0 0 22px rgba(46, 219, 127, 0.12);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}
.btn-lg {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
}

.validation-message {
  color: var(--text-error);
  min-height: 1.5em;
  font-weight: 500;
  font-size: 0.85rem;
}
.validation-message.hidden {
  display: none;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Table Defaults */
.widget-body table {
  border-collapse: collapse;
  width: 100%;
}
.widget-body th,
.widget-body td {
  border: 1px solid var(--card-border);
  padding: 0.6rem 0.5rem;
  text-align: left;
  vertical-align: middle;
}
.widget-body thead th {
  background-color: var(--input-bg);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.widget-body tbody tr:hover {
  background-color: rgba(108, 117, 125, 0.1);
}
.widget-body tfoot td {
  background-color: var(--input-bg);
  font-weight: 600;
}
.tl {
  text-align: left;
}
.tc {
  text-align: center;
}
.tr {
  text-align: right;
}

/* ========================================= */
/* === SISTEMA DE NOTIFICAÇÕES (TOAST) === */
/* ========================================= */

#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none; /* Permite clicar através do container */
}

.toast {
  pointer-events: auto; /* Reabilita cliques no toast */
  min-width: 300px;
  max-width: 400px;
  background: linear-gradient(180deg, rgba(13, 26, 50, 0.96), rgba(7, 15, 30, 0.98));
  border-left: 4px solid;
  border-radius: 0.9rem;
  padding: 1rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.36);
  color: var(--text-primary);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.hide {
  opacity: 0;
  transform: translateX(100%);
}

/* Variantes de Cor */
.toast-success {
  border-left-color: var(--result-correct-text); /* #4bc082 */
}
.toast-success .toast-icon {
  color: var(--result-correct-text);
}

.toast-error {
  border-left-color: var(--result-incorrect-text); /* #ff6384 */
}
.toast-error .toast-icon {
  color: var(--result-incorrect-text);
}

.toast-info {
  border-left-color: #3b82f6; /* Azul */
}
.toast-info .toast-icon {
  color: #3b82f6;
}

.toast-warning {
  border-left-color: var(--neon-orange); /* Laranja */
}
.toast-warning .toast-icon {
  color: var(--neon-orange);
}

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

.toast-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  margin-left: 1rem;
  transition: color 0.2s;
}

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

/* Ajustes de responsividade e feedback visual */
/* Responsividade (Mobile) */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    overflow: auto;
  }
  main#main-content {
    height: auto;
    overflow: visible;
  }
  .page-content {
    overflow-y: visible;
    padding: 1rem;
  }

  aside#sidebar,
  aside#sidebar.sidebar-collapsed {
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid #343a40;
    padding: 0.5rem 0;
    transition: none;
    overflow: visible;
  }
  aside#sidebar > div:first-child {
    display: flex;
    flex-grow: 1;
    justify-content: space-around;
    align-items: center;
  }
  aside#sidebar .profile-section,
  aside#sidebar.sidebar-collapsed .profile-section {
    display: none !important;
  }
  aside#sidebar nav,
  aside#sidebar.sidebar-collapsed nav {
    display: flex;
    width: auto;
  }
  aside#sidebar nav ul,
  aside#sidebar.sidebar-collapsed nav ul {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
  }
  aside#sidebar nav li,
  aside#sidebar.sidebar-collapsed nav li {
    flex-shrink: 0;
  }
  aside#sidebar nav li a,
  aside#sidebar.sidebar-collapsed nav li a {
    padding: 0.75rem;
    border-left: none;
    border-bottom: 1px solid transparent;
    justify-content: center;
    overflow: visible;
  }
  aside#sidebar nav li.active a,
  aside#sidebar.sidebar-collapsed nav li.active a {
    background: none;
    border-bottom-color: var(--sidebar-active-bg);
  }
  aside#sidebar nav li a .lucide,
  aside#sidebar.sidebar-collapsed nav li a .lucide {
    margin-right: 0;
    font-size: 1.3em;
  }
  aside#sidebar nav span:not(.lucide),
  aside#sidebar.sidebar-collapsed nav span:not(.lucide) {
    display: none !important;
  }
  aside#sidebar .sidebar-bottom-links,
  aside#sidebar.sidebar-collapsed .sidebar-bottom-links {
    display: none !important;
  }
  aside#sidebar #sidebar-toggle-btn,
  aside#sidebar.sidebar-collapsed #sidebar-toggle-btn {
    display: none !important;
  }

  .page-header {
    font-size: 1.2rem;
    padding: 1rem 1rem 0 1rem;
  }
  .widget-body {
    padding: 1rem;
  }
  .module-content {
    width: 100%;
  }
}

/* ========================================= */
/* === SCROLLBAR PERSONALIZADA (WebKit) === */
/* ========================================= */

/* Barra fina e discreta */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

/* Fundo da barra (transparente ou escuro) */
::-webkit-scrollbar-track {
  background: transparent;
}

/* O "polegar" da barra (a parte que mexe) */
::-webkit-scrollbar-thumb {
  background: #4b5563; /* Cinza médio */
  border-radius: 3px;
}

/* Quando passa o mouse em cima */
::-webkit-scrollbar-thumb:hover {
  background: #6b7280; /* Cinza mais claro */
}

/* Ajuste específico para o Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #4b5563 transparent;
}

/* ========================================= */
/* === MODAL STYLES === */
/* ========================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.flex {
  display: flex !important;
}

/* Garante que o modal apareça mesmo com a classe hidden do Tailwind */
.modal-overlay.flex.hidden {
  display: flex !important;
}

#modal-prova.flex {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.modal-content {
  background: linear-gradient(180deg, rgba(13, 26, 50, 0.97), rgba(7, 15, 30, 0.99));
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  box-shadow:
    0 0 0 1px rgba(46, 219, 127, 0.05),
    0 26px 70px rgba(0, 0, 0, 0.42),
    0 0 54px rgba(37, 99, 235, 0.1);
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease-out;
  position: relative;
  z-index: 10000;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}

.modal-close,
.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
}

.modal-close:hover,
.btn-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
  background-color: rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--input-text);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: var(--input-focus-shadow);
  background-color: #3a3f45;
}

.btn-modal-cancel {
  padding: 0.625rem 1.25rem;
  background-color: var(--input-bg);
  color: var(--text-primary);
  border: 1px solid var(--input-border);
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-cancel:hover {
  background-color: var(--card-border);
  border-color: var(--accent-color);
}
