/* ==========================================================================
   BioBaaS - Tema Acadêmico Clean & Claro (Fundo Branco - UNIVASF)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

:root {
  /* Raio Padronizado (Parte 2 do Pedido) */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 20px;
  --radius-full: 50%;

  /* Cores Institucionais - UNIVASF */
  --color-primary: #003366;
  --color-primary-light: #1a4b7a;
  --color-primary-dark: #002244;
  --color-accent: #1d4ed8;
  --color-accent-light: #3b82f6;
  --color-success: #047857;
  --color-warning: #d97706;
  --color-danger: #dc2626;

  /* Cores de Fundo e Texto */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-header: #0a0f1a;
  --bg-input: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-light: #f1f5f9;
  --border-color: #e2e8f0;
  --border-dark: #334155;

  /* Espaçamentos */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.15);

  /* Transições */
  --transition: all 0.2s ease;
  --transition-fast: 0.15s ease-in-out;

  /* Tipografia */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;

  /* Compatibilidade */
  --bg-main: #f8fafc;
  --bg-card-hover: #f1f5f9;
  --border-focus: #1d4ed8;
  --accent-primary: #1d4ed8;
  --accent-secondary: #0284c7;
  --accent-success: #047857;
  --accent-warning: #b45309;
  --accent-danger: #b91c1c;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow-x: clip !important;
}

main, .tab-content-wrapper {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Sidebar Esquerda de Navegação (Left Nav) — Tema Claro
   ========================================================================== */
.left-nav-sidebar {
  position: fixed;
  top: 68px; /* margem superior ampliada para respiro generoso abaixo da navbar */
  left: -240px; /* começa oculta */
  width: 220px;
  height: calc(100vh - 68px);
  background: #ffffff;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  z-index: 300; /* abaixo da navbar (400) mas acima do conteúdo */
  border-right: 1px solid #e2e8f0;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
  transition: left 0.25s ease, width 0.25s ease;
  padding-top: 0.75rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.left-nav-sidebar.open {
  left: 0;
}

/* Ícones vetoriais da sidebar */
.left-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  display: inline-block;
  vertical-align: middle;
}

/* Estado recolhido */
.left-nav-sidebar.collapsed {
  width: 48px;
  overflow: hidden;
}

.left-nav-sidebar.collapsed .left-nav-section-label,
.left-nav-sidebar.collapsed .left-nav-project-box,
.left-nav-sidebar.collapsed .left-nav-btn-text {
  display: none !important;
}

/* Centralizar ícones perfeitamente quando recolhido */
.left-nav-sidebar.collapsed .left-nav-btn {
  justify-content: center;
  padding: 0.55rem 0;
  gap: 0;
}

.left-nav-sidebar.collapsed .left-nav-section {
  padding: 0.5rem 0.25rem;
}

.left-nav-sidebar.collapsed .left-nav-footer {
  padding: 0.5rem 0.25rem;
}

.left-nav-btn-toggle {
  color: #64748b;
  font-size: 0.81rem;
}

.left-nav-btn-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.left-nav-toggle-arrow-svg {
  transition: transform 0.25s ease;
  color: #475569;
}

.left-nav-sidebar.collapsed .left-nav-toggle-arrow-svg {
  transform: rotate(180deg);
}

/* Quando a sidebar estiver aberta, o conteúdo principal recua */
#app-container.left-nav-open main,
#app-container.left-nav-open .tab-content-wrapper {
  margin-left: 220px;
  transition: margin-left 0.25s ease;
}

#app-container.left-nav-open.left-nav-collapsed main,
#app-container.left-nav-open.left-nav-collapsed .tab-content-wrapper {
  margin-left: 48px;
}

.left-nav-section {
  padding: 0.75rem 0.6rem 0.4rem;
  border-bottom: 1px solid #f1f5f9;
}

.left-nav-section-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0 0.35rem 0.4rem;
}

.left-nav-project-box {
  padding: 0 0.1rem;
}

.left-nav-project-dropdown {
  width: 100%;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.4rem 2rem 0.4rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #1e293b;
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.left-nav-project-dropdown:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.left-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.5rem 0.55rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.81rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background 0.13s ease, color 0.13s ease;
  margin-bottom: 1px;
  line-height: 1.3;
}

.left-nav-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.left-nav-btn:active {
  background: #e2e8f0;
}

.left-nav-btn-highlight {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 600;
}

.left-nav-btn-highlight:hover {
  background: #dbeafe;
  color: #1e40af;
}

.left-nav-btn-danger {
  color: #dc2626;
}

.left-nav-btn-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.left-nav-btn-logout {
  color: #64748b;
  font-size: 0.79rem;
}

.left-nav-btn-logout:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.left-nav-footer {
  margin-top: auto;
  padding: 0.85rem 0.6rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Nível 1: Navbar Institucional */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid #cbd5e1;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky !important;
  top: 0 !important;
  z-index: 400;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.brand-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 30px;
  background: #cbd5e1;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: #475569;
  font-weight: 500;
}

/* Nível 2: Barra de Controle de Projetos e Ações */
.control-bar {
  background: #ffffff;
  border-bottom: 1px solid #cbd5e1;
  padding: 0.6rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.project-control-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md);
}

.project-control-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.project-select-dropdown {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0.35rem 2rem 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  min-width: 260px;
  max-width: 380px;
}

.project-select-dropdown:focus {
  border-color: var(--border-focus);
}

.action-btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.user-status {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-success);
}

.status-dot.offline {
  background: var(--text-muted);
}

/* Perfil do Usuário na Navbar */
.navbar-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.navbar-profile:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid #ffffff;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Container Principal Unificado */
.main-content-container, .container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* Tabs Section Header */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.65rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: var(--transition-fast);
  margin-bottom: -2px;
}

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

.tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: 600;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.kpi-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: #1e40af;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2);
}

.btn-secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-success, .btn-emerald {
  background: var(--accent-success);
  color: #ffffff;
}

.btn-success:hover, .btn-emerald:hover {
  background: #065f46;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.2);
}

.btn-warning {
  background: var(--accent-warning);
  color: #ffffff;
}

.btn-warning:hover {
  background: #92400e;
}

.btn-danger {
  background: var(--color-danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #b91c1c;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-outline-danger {
  background: #ffffff;
  border-color: #fca5a5;
  color: #dc2626;
}

.btn-outline-danger:hover {
  background: #fef2f2;
  border-color: #dc2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Custom Checkboxes */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  margin: 0;
  vertical-align: middle;
}

input[type="checkbox"]:hover {
  border-color: #94a3b8;
}

input[type="checkbox"]:checked {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

input[type="checkbox"]:checked::after {
  content: "✓";
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 700;
}

/* Tables */
.table-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.table-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

th {
  background: #f8fafc;
  padding: 10px 12px;
  color: #475569;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-primary);
  white-space: normal;
  word-break: break-word;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f8fafc;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.badge-slate { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.badge-blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-emerald { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-info { background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; }
.badge-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-purple { background: #7c3aed; color: #ffffff; border: 1px solid #6d28d9; }

/* Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  min-width: 0;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-input, .form-select, .form-textarea, .form-control {
  width: 100%;
  box-sizing: border-box;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  min-width: 0;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus, .form-control:focus {
  border-color: #1d4ed8 !important;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12) !important;
}

/* Transições suaves de seções / abas */
section[id^="sec-"] {
  opacity: 0;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

section[id^="sec-"].active-section,
section[id^="sec-"].active {
  opacity: 1 !important;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

/* Live Calculator Box */
.calc-preview-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.calc-stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

.calc-stat-val {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}

#modal-dev-panel .modal-card {
  width: 1420px;
  max-width: 96vw;
  max-height: 92vh;
  padding: 2.25rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.dev-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dev-stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem 1.15rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dev-stat-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.dev-stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
}

/* Abas de Navegação do Painel Dev com Borda Inferior e Destaque Visual */
.dev-modal-nav-tabs {
  display: flex;
  gap: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.85rem;
  margin-bottom: 1.5rem;
}

.dev-nav-tab-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.5rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.dev-nav-tab-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.dev-nav-tab-btn.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
}

.dev-panel-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.dev-panel-table-wrap {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.dev-panel-table-wrap table {
  margin-bottom: 0;
  width: 100%;
}

.dev-panel-table-wrap th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  z-index: 2;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.03em;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #cbd5e1;
}

.dev-panel-table-wrap td {
  padding: 0.75rem 0.85rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.82rem;
}

.badge-role-staff {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
  font-weight: 700;
}

.badge-role-prof {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 600;
}

.badge-role-student {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-weight: 500;
}

.dev-action-btn-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.dev-pwd-group {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.35rem;
}


.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.75rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

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

/* Footer Institucional */
footer {
  margin-top: auto;
  text-align: center;
  padding: 1.25rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

/* Footer & Links Rápidos de Manuais e Termos — Sempre ao Fim da Página */
.app-footer {
  margin-top: auto !important;
  position: relative !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  padding: 12px 24px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  font-size: 0.8rem !important;
  color: #64748b !important;
  box-shadow: none !important;
  transition: margin-left 0.25s ease, width 0.25s ease;
}

#app-container.left-nav-open .app-footer {
  margin-left: 220px !important;
  width: calc(100% - 220px) !important;
}

#app-container.left-nav-open.left-nav-collapsed .app-footer {
  margin-left: 48px !important;
  width: calc(100% - 48px) !important;
}

.app-footer-left, .footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 500;
}

.app-footer-right, .footer-center, .footer-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #475569;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.footer-link:hover {
  color: #1d4ed8;
  background: #f1f5f9;
  text-decoration: none;
}

.footer-link i {
  font-size: 0.85rem;
  color: #64748b;
  display: inline-block;
  vertical-align: middle;
}

.footer-link:hover i {
  color: #1d4ed8;
}

/* Responsividade do Footer */
@media (max-width: 768px) {
  #app-container.left-nav-open .app-footer,
  #app-container.left-nav-open.left-nav-collapsed .app-footer {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .app-footer {
    padding: 12px 16px !important;
    flex-direction: column !important;
    text-align: center !important;
    gap: 8px !important;
  }

  .footer-center {
    justify-content: center !important;
    gap: 6px !important;
  }

  .footer-link {
    font-size: 0.75rem !important;
    padding: 3px 6px !important;
  }
}

/* Estilização Acadêmica do Chat de IA Conversacional (NVIDIA NIM) */
.chat-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-history-window {
  height: 450px;
  max-height: 450px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  scroll-behavior: smooth;
}

.chat-bubble-user {
  align-self: flex-end;
  background: #1d4ed8;
  color: #ffffff;
  padding: 0.75rem 1.1rem;
  border-radius: 14px 14px 2px 14px;
  max-width: 82%;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.chat-bubble-ai {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #1d4ed8;
  color: #0f172a;
  padding: 0.85rem 1.1rem;
  border-radius: 14px 14px 14px 2px;
  max-width: 90%;
  font-size: 0.88rem;
  line-height: 1.6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
}

/* Padronização de todas as seções de abas */
.tab-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

.tab-pane, section[id^="sec-"] {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  flex-grow: 1;
}

.tab-content, .tab-pane {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  margin-top: 0 !important;
  padding-top: 8px !important;
}

#sec-dashboard {
  padding-top: 0 !important;
  margin-top: 0 !important;
  min-height: auto !important;
}

/* ==========================================================================
   Landing Page - Tema Claro (Light Mode Corporativo Institucional UNIVASF)
   ========================================================================== */
#landing-page {
  background: #ffffff !important;
  color: #0f172a !important;
}

#landing-page h1 {
  color: #0f172a !important;
}

#landing-page p {
  color: #475569 !important;
}

.landing-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.landing-card-title {
  color: #0f172a !important;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.landing-card-text {
  color: #64748b !important;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Banner de Perfil do Usuário no Dashboard (Light Mode) */
.user-profile-banner {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  color: #0f172a !important;
}

/* === Sidebar do Console de Análise — Tema Claro === */
#ai-analysis-sidebar,
.ai-analysis-sidebar,
.analysis-console {
    position: fixed !important;
    top: 0 !important;
    right: -420px !important;
    width: 420px !important;
    max-width: 90vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    transition: right 0.3s ease-in-out !important;
    display: flex !important;
    flex-direction: column !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif !important;
    overflow: hidden !important;
    border-left: 1px solid #e2e8f0 !important;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08) !important;
}

/* Estado aberto */
#ai-analysis-sidebar.open,
.ai-analysis-sidebar.open,
.analysis-console.open,
#ai-analysis-sidebar.active,
.ai-analysis-sidebar.active,
.analysis-console.active {
    right: 0 !important;
}

/* Cabeçalho */
.ai-sidebar-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 14px 20px !important;
    background-color: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    flex-shrink: 0 !important;
}
.ai-sidebar-title-box {
    display: flex !important;
    flex-direction: column !important;
}
.ai-sidebar-title {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #0f172a !important;
}
.ai-sidebar-subtitle {
    font-size: 0.72rem !important;
    color: #64748b !important;
    margin-top: 1px !important;
}
.ai-sidebar-close {
    background: none !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 5px !important;
    color: #64748b !important;
    font-size: 1.4rem !important;
    cursor: pointer !important;
    padding: 0 8px !important;
    line-height: 1.4 !important;
    transition: background 0.13s, color 0.13s !important;
}
.ai-sidebar-close:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Área de log (rolável) */
.ai-console-log {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 16px 20px !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: 0.88rem !important;
    line-height: 1.65 !important;
}
.ai-console-welcome {
    color: #94a3b8 !important;
    font-style: italic !important;
}
.ai-console-prompt-mono {
    color: #1d4ed8 !important;
    font-weight: 500 !important;
    font-family: 'Courier New', monospace !important;
}

/* Markdown dentro do Console */
.ai-console-response-mono p {
  margin-bottom: 0.65rem;
  color: #1e293b;
}

.ai-console-response-mono h1,
.ai-console-response-mono h2,
.ai-console-response-mono h3,
.ai-console-response-mono h4 {
  color: #1d4ed8;
  margin: 0.75rem 0 0.4rem 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.ai-console-response-mono ul,
.ai-console-response-mono ol {
  padding-left: 1.2rem;
  margin-bottom: 0.65rem;
  color: #334155;
}

.ai-console-response-mono li {
  margin-bottom: 0.25rem;
}

.ai-console-response-mono table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.8rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ai-console-response-mono th,
.ai-console-response-mono td {
  padding: 0.45rem 0.6rem;
  border: 1px solid #e2e8f0;
  text-align: left;
  color: #1e293b;
}

.ai-console-response-mono th {
  background: #f1f5f9;
  color: #1d4ed8;
  font-weight: 600;
}

.ai-console-response-mono pre {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  overflow-x: auto;
  margin: 0.75rem 0;
  max-width: 100%;
}

.ai-console-response-mono code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.82rem;
  border-radius: 3px;
  color: #1e293b;
}

.ai-console-response-mono p code {
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0.1rem 0.35rem;
}

.ai-console-meta-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  margin-top: 0.6rem;
  font-weight: 500;
}

/* Skeleton loading */
.ai-console-loading {
    padding: 12px 20px !important;
}
.ai-skeleton-line {
    height: 12px !important;
    background: #e2e8f0 !important;
    border-radius: 4px !important;
    margin-bottom: 6px !important;
    animation: pulse 1.5s infinite !important;
}
.ai-skeleton-line.short { width: 30% !important; }
.ai-skeleton-line.medium { width: 60% !important; }
.ai-skeleton-line.long { width: 90% !important; }
@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Área de entrada */
.ai-console-input-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 12px 20px !important;
    background-color: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    flex-shrink: 0 !important;
}
.ai-console-textarea {
    width: 100% !important;
    padding: 8px 12px !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    color: #0f172a !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: 0.88rem !important;
    resize: vertical !important;
    min-height: 48px !important;
    outline: none !important;
    box-sizing: border-box !important;
}
.ai-console-textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.12) !important;
}
.ai-console-controls-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
}
.ai-console-mic-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    border: 1px solid #cbd5e1 !important;
    background-color: #ffffff !important;
    color: #334155 !important;
    font-size: 0.84rem !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    height: 38px !important;
}
.ai-console-mic-btn:hover {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}
.ai-console-mic-btn.recording {
    background-color: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #b91c1c !important;
    animation: mic-pulse 1.2s infinite !important;
}
@keyframes mic-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.ai-console-submit-btn {
    background-color: #1d4ed8 !important;
    border: none !important;
    border-radius: 6px !important;
    color: #ffffff !important;
    padding: 8px 18px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    height: 38px !important;
    transition: background 0.13s !important;
}
.ai-console-submit-btn:hover {
    background-color: #1e40af !important;
}

/* Otimização de Impressão (CSS Print Media) */
@media print {
  @page {
    size: A4 portrait;
    margin: 1cm;
  }
  body {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #ffffff !important;
  }
  .report-container, .exec-report-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    page-break-inside: avoid;
  }
  table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }
  th, td {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
  h1, h2, h3, .header-section {
    page-break-after: avoid;
  }
}

/* Barra de Avaliação / Feedback Científico do Assistente */
.ai-feedback-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
}

.ai-feedback-hint {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
  user-select: none;
}

.ai-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-feedback-btn:hover:not(:disabled) {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-primary, #0f172a);
  border-color: var(--border-color, #cbd5e1);
}

.ai-feedback-btn.active {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
  font-weight: 600;
}

.ai-feedback-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

/* Barra de Busca Global Inteligente (LabCollector Search Agent) */
.global-search-container {
  position: relative;
  flex: 1;
  max-width: 480px;
  margin: 0 1rem;
}

.global-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.global-search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted, #64748b);
  pointer-events: none;
}

.global-search-input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-primary, #0f172a);
  outline: none;
  transition: all 0.2s ease;
}

.global-search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.global-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1000;
  padding: 0.5rem 0;
}

.global-search-header {
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
  border-bottom: 1px solid var(--border-color, #f1f5f9);
}

.global-search-category {
  padding: 0.45rem 0.85rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.04);
  text-transform: uppercase;
  margin-top: 0.35rem;
}

.global-search-item {
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(226, 232, 240, 0.4);
  transition: background 0.15s ease;
}

.global-search-item:hover {
  background: var(--bg-hover, #f8fafc);
}

.global-search-item-title {
  font-size: 0.85rem;
  color: var(--text-primary, #0f172a);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.global-search-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -------------------------------------------------------------
   SISTEMA DE TOASTS (NOTIFICAÇÕES CIENTÍFICAS)
   ------------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  width: calc(100% - 40px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.14), 0 1px 3px rgba(0,0,0,0.08);
  font-size: 0.88rem;
  color: var(--text-primary, #0f172a);
  border-left: 4px solid var(--accent-primary, #1d4ed8);
  animation: toastSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.toast-success { border-left-color: #047857; }
.toast.toast-error { border-left-color: #dc2626; }
.toast.toast-warning { border-left-color: #d97706; }
.toast.toast-info { border-left-color: #1d4ed8; }

.toast-message {
  flex: 1;
  line-height: 1.45;
  word-break: break-word;
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s ease;
}
.toast-close:hover {
  color: #0f172a;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.toast-fade-out {
  opacity: 0;
  transform: translateX(20px);
}

/* -------------------------------------------------------------
   FEEDBACK VISUAL: SPINNERS DE CARREGAMENTO
   ------------------------------------------------------------- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.7s linear infinite;
}

.spinner-primary {
  border-color: rgba(29, 78, 216, 0.2);
  border-top-color: #1d4ed8;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* -------------------------------------------------------------
   HAMBURGER & SIDEBAR BACKDROP
   ------------------------------------------------------------- */
.btn-hamburger {
  display: none;
  background: none;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 6px;
  padding: 6px;
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-hamburger:hover {
  background: #f1f5f9;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 10040;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* -------------------------------------------------------------
   RESPONSIVIDADE CIENTÍFICA (MOBILE-FIRST BREAKPOINTS)
   ------------------------------------------------------------- */

/* SMARTPHONES (< 768px) */
@media (max-width: 768px) {
  .btn-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .brand-subtitle {
    display: none;
  }

  .brand-logo {
    height: 28px;
  }

  .global-search-container {
    max-width: 150px;
  }

  .left-nav-sidebar {
    width: 280px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 10050;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }

  .left-nav-sidebar.mobile-open {
    transform: translateX(0);
  }

  #app-container {
    padding-left: 0 !important;
  }

  .ai-analysis-sidebar {
    width: 100vw !important;
    max-width: 100vw !important;
    right: -100vw;
  }

  .ai-analysis-sidebar.open {
    right: 0;
  }

  .kpi-grid {
    grid-template-columns: 1fr !important;
  }

  .form-row, [style*="grid-template-columns: 1fr 1.5fr"] {
    grid-template-columns: 1fr !important;
  }

  .modal-card {
    width: 90vw !important;
    max-width: 90vw !important;
    margin: 1rem auto;
    padding: 16px !important;
  }

  .modal-buttons {
    flex-direction: column;
    width: 100%;
  }

  .modal-buttons button {
    width: 100%;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.85rem;
  }

  .table-container table {
    min-width: 580px;
    font-size: 0.82rem;
  }

  .table-container th, .table-container td {
    padding: 8px 10px;
  }

  .tabs-nav {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

/* TABLETS (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .left-nav-sidebar {
    width: 200px;
  }

  #app-container {
    padding-left: 200px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .modal-card {
    width: 80vw !important;
    max-width: 80vw !important;
  }

  .table-container table {
    font-size: 0.88rem;
  }
}

/* DESKTOP (> 1025px) */
@media (min-width: 1025px) {
  .btn-hamburger {
    display: none;
  }
  .sidebar-backdrop {
    display: none !important;
  }
}

/* Plotly Responsive Scientific Widgets */
.ai-plotly-widget, #custom-builder-plotly {
  width: 100% !important;
  min-height: 280px;
  overflow: hidden;
}

/* ============================================================
   MÊS 10.2: MODO LUVAS (FAB VOICE FLUTUANTE)
   ============================================================ */
.fab-voice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  border: 2px solid #38bdf8;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-voice.calc-open {
  right: auto;
  left: 2rem;
  bottom: 2rem;
}

.fab-voice:hover {
  transform: scale(1.08);
  background: #0369a1;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6);
}

.fab-voice.recording {
  background: #dc2626 !important;
  border-color: #f87171 !important;
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.8) !important;
  animation: pulse-red 1.2s infinite ease-in-out;
}

@keyframes pulse-red {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  50% { transform: scale(1.12); box-shadow: 0 0 0 14px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* ============================================================
   MÊS 10.2: GALERIA DE EVIDÊNCIAS & DROPZONE NO ELN
   ============================================================ */
.eln-media-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 1.5rem 1rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.eln-media-dropzone:hover, .eln-media-dropzone.dragover {
  border-color: #0284c7;
  background: #f0f9ff;
  transform: translateY(-1px);
}

.eln-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.eln-media-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.eln-media-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
  border-color: #cbd5e1;
}

.eln-media-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 4px;
  background: #f1f5f9;
}

.eln-media-info {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eln-media-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
  justify-content: flex-end;
}

/* ============================================================
   MÊS 10.2: WIDGET FLUTUANTE DE CALCULADORAS RÁPIDAS (DESIGN SYSTEM BIOBAAS)
   ============================================================ */
.calculator-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 480px;
  max-width: calc(100vw - 3rem);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 9998;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUpWidget 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpWidget {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.calculator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.2rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.calculator-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
}

.calculator-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.calculator-close-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
}

.calculator-tabs {
  display: flex;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.35rem 0.5rem 0 0.5rem;
  gap: 0.35rem;
  overflow-x: auto;
}

.calc-tab-btn {
  background: transparent;
  border: none;
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 600;
  border-radius: 6px 6px 0 0;
  transition: all 0.15s ease;
}

.calc-tab-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.calc-tab-btn.active {
  color: #0284c7;
  border-bottom-color: #0284c7;
  background: #ffffff;
  font-weight: 700;
}

.calculator-body {
  padding: 1.15rem;
  background: #ffffff;
}

.calculator-body .form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155 !important;
  margin-bottom: 0.25rem;
}

.calculator-body .form-input,
.calculator-body .form-select {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-size: 0.82rem;
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
}

.calculator-body .form-input:focus,
.calculator-body .form-select:focus {
  background: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

.calculator-result-badge {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0369a1;
  text-align: center;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.05);
}

/* ============================================================
   MÊS 10.2: CHECKLIST DE PROCEDIMENTOS PADRÃO (SOP/POP)
   ============================================================ */
.sop-item-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #334155;
  padding: 0.2rem 0;
  cursor: pointer;
}

.sop-item-row input[type="checkbox"] {
  margin-top: 0.15rem;
  cursor: pointer;
}

.sop-item-row.completed span {
  text-decoration: line-through;
  color: #94a3b8;
}


/* ============================================================
   PLANILHA INTERATIVA AVANCADA — TOOLBAR, BOTOES E PAINEL
   ============================================================ */

.sheet-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  margin-bottom: 0.6rem;
  overflow-x: auto;
}

.sheet-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.sheet-toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border-color, #e2e8f0);
  margin: 0 0.35rem;
  flex-shrink: 0;
}

.sheet-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #475569);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
  line-height: 1;
  font-family: inherit;
}

.sheet-tool-btn svg {
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.14s ease;
}

.sheet-tool-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-primary, #0f172a);
  border-color: var(--border-color, #e2e8f0);
}

.sheet-tool-btn:hover svg {
  opacity: 1;
}

.sheet-tool-btn:active {
  background: #e2e8f0;
  transform: translateY(0.5px);
}

/* Botao primario (Salvar) */
.sheet-tool-btn-primary {
  background: var(--accent-primary, #6366f1);
  color: #ffffff !important;
  border-color: var(--accent-primary, #6366f1);
}

.sheet-tool-btn-primary svg {
  opacity: 1;
}

.sheet-tool-btn-primary:hover {
  background: hsl(239, 84%, 57%);
  border-color: hsl(239, 84%, 57%);
  color: #ffffff;
}

/* Botao destrutivo (Remover Coluna) */
.sheet-tool-btn-danger {
  color: #ef4444;
}

.sheet-tool-btn-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Estado ativo (congelamento ativo) */
.btn-active-tool {
  background: hsl(239, 84%, 96%);
  color: var(--accent-primary, #6366f1) !important;
  border-color: hsl(239, 84%, 85%);
}

.btn-active-tool svg {
  opacity: 1;
}

/* Painel de grafico */
#spreadsheet-chart-panel {
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Responsividade da toolbar */
@media (max-width: 768px) {
  .sheet-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 0.4rem 0.5rem;
  }

  .sheet-tool-btn {
    padding: 0.28rem 0.45rem;
    font-size: 0;         /* Ocultar texto em mobile, manter apenas icone */
  }

  .sheet-tool-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* ==========================================================================
   FUNCIONALIDADE 4 & 5: RESPONSIVIDADE AVANÇADA & MICROINTERAÇÕES (UI/UX)
   ========================================================================== */

/* 1. Animações e Microinterações Globais */
.btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}

.btn:hover {
  transform: scale(1.02);
}

.btn:active {
  transform: scale(0.98);
}

/* Hover suave em Cards e Containers */
.card, .kpi-card, .landing-card, .dataset-card, .eln-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover, .kpi-card:hover, .landing-card:hover, .dataset-card:hover, .eln-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* Hover suave nas linhas de tabelas */
tbody tr {
  transition: background-color 0.15s ease;
}

tbody tr:hover {
  background-color: rgba(241, 245, 249, 0.7);
}

/* 2. Animação de Entrada para Modais */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-card {
  animation: fadeInUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  width: min(92vw, 620px);
  max-height: 90vh;
  overflow-y: auto;
}

/* 3. Sidebar com rolagem vertical suave e botões flex-shrink 0 */
.left-nav-sidebar {
  position: fixed;
  top: 68px;
  left: -240px;
  width: 220px;
  height: calc(100vh - 68px);
  max-height: calc(100vh - 68px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s ease;
}

.left-nav-btn {
  flex-shrink: 0;
}

.left-nav-footer {
  margin-top: auto;
  flex-shrink: 0;
  border-top: 1px solid #e2e8f0;
  padding: 0.5rem 0.6rem;
  background: #ffffff;
  position: sticky;
  bottom: 0;
  z-index: 5;
}

#app-container {
  max-width: 100vw;
  overflow-x: clip;
  min-height: 100vh;
  min-height: 100dvh;
  flex: 1 0 auto;
  display: flex !important;
  flex-direction: column !important;
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#app-container[style*="none"] {
  display: none !important;
}

/* 4. Tabelas Responsivas com rolagem horizontal suave */
.table-container, .table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

/* 5. Grid Adaptativo de KPIs e Cards */
.kpi-grid, .dash-kpi-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* 6. Breakpoints de Responsividade Rigorosos */

/* Smartphones (< 768px) */
@media (max-width: 767px) {
  /* Sidebar como drawer overlay */
  #left-nav-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -300px !important;
    width: 280px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    z-index: 1000 !important;
    transition: left 0.3s ease !important;
    box-shadow: none !important;
  }
  #left-nav-sidebar.mobile-open {
    left: 0 !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15) !important;
  }
  #sidebar-backdrop {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.4) !important;
    z-index: 999 !important;
  }
  #sidebar-backdrop.active {
    display: block !important;
  }
  
  /* Navbar compacta */
  .navbar {
    padding: 0.5rem 0.75rem !important;
    flex-wrap: nowrap !important;
  }
  .btn-hamburger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  .brand-title { font-size: 1rem !important; }
  .brand-subtitle { display: none !important; }
  .brand-logo { max-height: 32px !important; }
  .global-search-container { max-width: 120px !important; }
  
  /* Perfil na navbar em mobile */
  .profile-name { display: none !important; }
  .navbar-profile { padding: 0.2rem 0.35rem !important; }
  
  /* Conteúdo principal */
  .main-content-container, .tab-content-container {
    padding: 0.5rem !important;
  }
  
  /* Tabelas */
  .table-container, .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  table { font-size: 0.75rem !important; }
  table th, table td { padding: 0.4rem 0.5rem !important; }
  
  /* KPIs em 1 coluna */
  .kpi-grid, .dash-kpi-container {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }
  
  /* Modais */
  .modal-card {
    width: 92vw !important;
    max-width: 92vw !important;
    padding: 1rem !important;
    margin: 0.5rem !important;
  }
  .modal-card .form-group {
    margin-bottom: 0.5rem !important;
  }
  
  /* Toolbar de planilhas */
  .sheet-toolbar {
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
  }
  .sheet-toolbar .btn {
    padding: 0.2rem 0.5rem !important;
    font-size: 0.75rem !important;
  }
  .sheet-toolbar .btn span {
    display: none !important;
  }
  .sheet-toolbar .btn .btn-icon-only {
    display: inline !important;
  }
}

/* Tablets (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  #left-nav-sidebar {
    width: clamp(180px, 18vw, 220px) !important;
  }
  .btn-hamburger {
    display: inline-flex !important;
  }
  .kpi-grid, .dash-kpi-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  table { font-size: 0.82rem !important; }
  .modal-card {
    width: 85vw !important;
    max-width: 85vw !important;
  }
  .global-search-container {
    max-width: 240px !important;
  }
}

/* Desktops e Monitores Maiores (>= 1025px) */
@media (min-width: 1025px) {
  .tab-content-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
  }
}

/* ==========================================================================
   EDITORES WYSIWYG (QUILL) PARA RELATÓRIOS E BOTÕES DE GERAÇÃO POR IA
   ========================================================================== */
.report-section-editor-block {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.report-section-editor-block:focus-within {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.report-quill-editor {
  min-height: 120px;
  max-height: 260px;
  overflow-y: auto;
  font-size: 0.85rem;
  font-family: inherit;
  color: #1e293b;
  border-radius: 0 0 6px 6px;
}

.report-quill-editor .ql-editor {
  min-height: 110px;
  max-height: 240px;
  line-height: 1.55;
  padding: 0.65rem 0.85rem;
}

.report-quill-editor .ql-editor p {
  margin-bottom: 0.5rem;
}

.report-quill-editor .ql-editor em {
  font-style: italic;
}

.report-quill-editor .ql-editor strong {
  font-weight: 600;
}

.report-quill-editor + .ql-toolbar.ql-snow,
.report-section-editor-block .ql-toolbar.ql-snow {
  background: #f1f5f9;
  border-color: #cbd5e1;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  padding: 4px 8px;
}

.report-section-editor-block .ql-container.ql-snow {
  border-color: #cbd5e1;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

.btn-generate-section {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
  font-size: 0.73rem !important;
  padding: 0.25rem 0.65rem !important;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.btn-generate-section:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.btn-generate-section:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-generate-section.loading svg {
  animation: spin 0.8s linear infinite;
}

/* Labels e Checkboxes Modernos para o Modal de Relatórios */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #1e293b;
  cursor: pointer;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.checkbox-label:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1d4ed8;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.report-section {
  margin-bottom: 1.25rem;
}

.report-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1d4ed8;
  margin: 0 0 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .form-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Modal de Validação Pública de Relatórios */
#modal-validate-report .modal-card {
  max-width: 500px;
  width: 90vw;
  padding: 24px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

#modal-validate-report .modal-body {
  padding: 0;
  max-height: none;
  overflow: visible;
}

#modal-validate-report .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

#validate-report-result .valid-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 16px;
}

#validate-report-result .invalid-card {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 16px;
}

#validate-report-result .warning-card {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 16px;
}

/* ---------------------------------------------------------------------------
 * Estilos para Equipe, Perfil de Usuário e Cards Públicos
 * --------------------------------------------------------------------------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.team-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.team-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.team-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #3b82f6;
  margin-bottom: 0.75rem;
  background: #f1f5f9;
}

.team-card-initials {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #1e293b;
  font-weight: 700;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  border: 2.5px solid #cbd5e1;
}

.team-card-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #0f172a;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.team-card-role {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.team-card-dept {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.team-card-socials {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.social-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.social-linkedin {
  background: #eff6ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.social-linkedin:hover {
  background: #0284c7;
  color: #ffffff;
}

.social-lattes {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.social-lattes:hover {
  background: #334155;
  color: #ffffff;
}

/* Garantir que o modal de senha e o custom-modal fiquem à frente do Painel Dev */
#modal-temp-password,
#custom-modal,
.custom-modal-overlay,
#custom-confirm-modal {
  z-index: 999999 !important;
}

/* Mensagens de Sistema do Chat (Início / Fim de Suporte / Notificações) */
.chat-system-message {
  display: flex;
  justify-content: center;
  margin: 12px 0;
  width: 100%;
}

.system-message-content {
  background: #f1f5f9;
  color: #475569;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  text-align: center;
  max-width: 85%;
  border: 1px solid #e2e8f0;
  white-space: pre-line;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.system-message-content .icon {
  margin-right: 6px;
}

.system-message-content .highlight {
  font-weight: 600;
  color: #1d4ed8;
}

/* Toolbar do Painel de Suporte */
.support-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.support-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.support-filter-group label {
  font-size: 0.84rem;
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.support-filter-group select {
  width: auto;
  min-width: 170px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.84rem;
  height: 34px;
}

/* ==========================================================================
   CUSTOMIZAÇÃO DE ELEMENTOS NATIVOS DO NAVEGADOR (DESIGN SYSTEM BIOBAAS)
   ========================================================================== */

/* ============================================
   TAREFA 1: SCROLLBAR CUSTOMIZADA (WebKit: Chrome, Edge, Safari)
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
    border: 2px solid #f8fafc;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

::-webkit-scrollbar-thumb:active {
    background: #1d4ed8;
}

::-webkit-scrollbar-corner {
    background: #f8fafc;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

/* ============================================
   TAREFA 2: SELEÇÃO DE TEXTO CUSTOMIZADA
   ============================================ */
::selection {
    background-color: #1d4ed8;
    color: #ffffff;
}

::-moz-selection {
    background-color: #1d4ed8;
    color: #ffffff;
}


/* ============================================
   TAREFA 3: FOCO E OUTLINES CUSTOMIZADOS
   ============================================ */
*:focus {
    outline: none !important;
}

*:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.25) !important;
    border-radius: 4px;
}

/* Botões e inputs com foco mais destacado */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.35) !important;
    border-color: #1d4ed8 !important;
}

/* ============================================
   TAREFA 4: CARET COLOR (Cursor de Texto)
   ============================================ */
input,
textarea,
[contenteditable="true"] {
    caret-color: #1d4ed8;
}

/* ============================================
   TAREFA 5: PLACEHOLDER CUSTOMIZADO
   ============================================ */
::placeholder {
    color: #94a3b8;
    opacity: 1;
    font-style: normal;
}

:-ms-input-placeholder {
    color: #94a3b8;
}

::-ms-input-placeholder {
    color: #94a3b8;
}

input:focus::placeholder,
textarea:focus::placeholder {
    color: #cbd5e1;
}

/* ============================================
   TAREFA 6: AUTOFILL DO CHROME
   ============================================ */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #0f172a !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: #1d4ed8;
}

/* ============================================
   TAREFA 7: RADIO BUTTONS CUSTOMIZADOS
   ============================================ */
input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    vertical-align: middle;
    margin-right: 8px;
    background: #ffffff;
    flex-shrink: 0;
}

input[type="radio"]:hover {
    border-color: #1d4ed8;
}

input[type="radio"]:checked {
    border-color: #1d4ed8;
    background: #ffffff;
}

input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #1d4ed8;
}

input[type="radio"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.25);
}

input[type="radio"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
}

/* ============================================
   TAREFA 8: SELECT CUSTOMIZADO
   ============================================ */
select,
select.form-select,
.left-nav-project-dropdown,
.project-select-dropdown {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 16px 16px !important;
    padding-right: 36px !important;
    cursor: pointer;
}

select:focus,
select.form-select:focus,
.left-nav-project-dropdown:focus,
.project-select-dropdown:focus {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231d4ed8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 16px 16px !important;
}

select::-ms-expand {
    display: none;
}

select option {
    background-color: #ffffff;
    color: #0f172a;
}

/* ============================================
   TAREFA 9: FILE INPUT CUSTOMIZADO
   ============================================ */
input[type="file"] {
    color: #64748b;
    font-size: 0.85rem;
    position: relative;
}

input[type="file"]::file-selector-button {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
    background: #e2e8f0;
    border-color: #1d4ed8;
    color: #1d4ed8;
}

input[type="file"]::file-selector-button:active {
    transform: scale(0.98);
}

/* ============================================
   TAREFA 10: NUMBER INPUT - REMOVER SPINNERS
   ============================================ */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ============================================
   TAREFA 11: TEXTAREA RESIZE HANDLE
   ============================================ */
textarea {
    resize: vertical;
}

textarea::-webkit-resizer {
    background: transparent;
    border: 4px solid transparent;
    border-right-color: #cbd5e1;
    border-bottom-color: #cbd5e1;
}

/* ============================================
   TAREFA 12: DETAILS/SUMMARY
   ============================================ */
details > summary {
    list-style: none;
    cursor: pointer;
}

details > summary::-webkit-details-marker {
    display: none;
}

details > summary::before {
    content: "▶";
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.2s ease;
    color: #64748b;
    font-size: 0.7rem;
}

details[open] > summary::before {
    transform: rotate(90deg);
}

/* ============================================
   TAREFA 13: BOTÕES E LINKS
   ============================================ */
a {
    color: #1d4ed8;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1e40af;
    text-decoration: underline;
}

button {
    font-family: inherit;
    cursor: pointer;
}
