@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Sora:wght@600;700&display=swap');

/* ==========================================
   DESIGN SYSTEM WISER ACADEMY / JUST-ONE v2.0
   ========================================== */

:root {
  color-scheme: light;
  /* Marca (Sky / Blue Wiser) */
  --wiser-50: #f0f9ff;
  --wiser-100: #e0f2fe;
  --wiser-200: #bae6fd;
  --wiser-300: #7dd3fc;
  --wiser-400: #38bdf8;
  --wiser-500: #0ea5e9;
  --wiser-600: #0284c7;
  --wiser-700: #0369a1;
  --wiser-800: #075985;
  --wiser-900: #0c4a6e;

  /* Superfícies & Neutros (Slate Light) */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-header: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #0ea5e9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);

  /* Acentos Semânticos */
  --emerald-50: #ecfdf5;
  --emerald-600: #10b981;
  --red-50: #fef2f2;
  --red-600: #ef4444;
  --amber-50: #fffbeb;
  --amber-600: #f59e0b;
}

.dark, [data-theme='dark'] {
  color-scheme: dark;
  /* Superfícies & Neutros (Slate Dark) */
  --bg-app: #0f172a;
  --bg-surface: #1e293b;
  --bg-sidebar: #1e293b;
  --bg-header: #1e293b;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --border-color: #334155;
  --border-focus: #38bdf8;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);

  --wiser-50: #0c4a6e;
  --wiser-100: #075985;
  --emerald-50: rgba(16, 185, 129, 0.15);
  --red-50: rgba(239, 68, 68, 0.15);
  --amber-50: rgba(245, 158, 11, 0.15);
}

/* ==========================================
   RESETS E TIPOGRAFIA
   ========================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

body, html {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  width: 100%;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.font-display {
  font-family: 'Sora', system-ui, sans-serif;
}

/* Ícones Lucide SVG */
.lucide-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.lucide-icon.lg {
  width: 22px;
  height: 22px;
}

/* ==========================================
   SHELL DO APLICATIVO
   ========================================== */

.app-root {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-app);
}

/* Sidebar Fixa w-72 (280px) */
.sidebar {
  width: 280px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}

.sidebar-logo-img {
  max-height: 44px;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.dark .sidebar-logo-img {
  filter: drop-shadow(0 0 6px rgba(14, 165, 233, 0.3)) brightness(1.1);
}

.login-logo-img {
  max-height: 64px;
  max-width: 100%;
  object-fit: contain;
  display: inline-block;
}

.dark .login-logo-img {
  filter: drop-shadow(0 0 10px rgba(14, 165, 233, 0.35)) brightness(1.1);
}

.sidebar-section-title {
  padding: 12px 12px 4px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-module {
  margin: 4px 0 10px;
}

.sidebar-module-title {
  padding: 6px 14px 2px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-module .sidebar-item {
  padding-left: 26px;
}

.sidebar-empty {
  padding: 8px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.sidebar-item:hover {
  background-color: var(--wiser-50);
  color: var(--wiser-600);
}

.dark .sidebar-item:hover {
  background-color: rgba(14, 165, 233, 0.15);
  color: var(--wiser-400);
}

.sidebar-item.active {
  background-color: var(--wiser-50);
  color: var(--wiser-700);
  font-weight: 600;
}

.dark .sidebar-item.active {
  background-color: rgba(14, 165, 233, 0.2);
  color: var(--wiser-300);
}

.sidebar-build {
  padding: 0 20px 10px;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.sidebar-footer {
  padding: 16px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-sidebar);
}

.theme-btn-sidebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
}

.theme-btn-sidebar:hover {
  background-color: var(--bg-app);
  color: var(--text-primary);
}

/* ==========================================
   CONTEÚDO PRINCIPAL & HEADER
   ========================================== */

.main-wrapper {
  flex: 1;
  margin-left: 280px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  height: 60px;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-breadcrumb .current {
  color: var(--text-primary);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.header-alerts {
  position: relative;
}

/* Sininho de Notificações */
.notification-bell-btn {
  position: relative;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}

.notification-bell-btn:hover {
  background-color: var(--bg-app);
  color: var(--text-primary);
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--red-600);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-header);
}

/* User Menu no Header */
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.user-menu-btn:hover {
  background-color: var(--bg-app);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wiser-500), var(--wiser-700));
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role-badge {
  font-size: 0.7rem;
  color: var(--wiser-600);
  font-weight: 500;
}

.dark .user-role-badge {
  color: var(--wiser-400);
}

/* Dropdown de Notificações */
.notifications-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  z-index: 120;
  display: none;
}

.notifications-dropdown.show {
  display: block;
}

.notif-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.notif-list {
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  cursor: pointer;
}

.notif-item:hover {
  background-color: var(--bg-app);
}

.notif-item.unread {
  background-color: var(--wiser-50);
}

.notif-item-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.notif-manage {
  font-size: 0.78rem;
  color: var(--wiser-500);
  cursor: pointer;
  font-weight: 600;
}
.notif-empty {
  padding: 18px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.notif-item-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-actions { display: inline-flex; flex-shrink: 0; }
.notif-clear {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border-color);
  background: none;
  color: var(--text-muted);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 0.8rem;
}
.notif-clear:hover { color: var(--text-primary); }

.notif-item-msg {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.3;
}

.notif-item-time {
  font-size: 0.7rem;
  color: var(--text-subtle);
  margin-top: 4px;
}

/* ==========================================
   PAGE CONTAINER & CABEÇALHOS
   ========================================== */

.page-container {
  padding: 32px;
  flex: 1;
  animation: fadeIn 0.3s ease-out;
}

.page-header-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  gap: 16px;
}

.page-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

/* ==========================================
   BOTÕES E AÇÕES
   ========================================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--wiser-600);
  color: white;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: var(--wiser-700);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
  color: white;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background-color: var(--bg-app);
  color: var(--text-primary);
}

.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-icon-action {
  background: none;
  border: none;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-icon-action:hover {
  background-color: var(--wiser-50);
  color: var(--wiser-600);
}

.btn-icon-action.delete:hover {
  background-color: var(--red-50);
  color: var(--red-600);
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 8px;
}

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

button.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}

button.btn:hover {
  border-color: var(--wiser-500);
  color: var(--wiser-600);
}

/* ==========================================
   CARDS & PAINÉIS
   ========================================== */

.card-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================
   TABELAS PROFISSIONAIS (WISER PATTERN)
   ========================================== */

.table-responsive {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

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

.data-table thead tr {
  background-color: var(--bg-app);
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s;
}

.data-table tbody tr:hover {
  background-color: var(--bg-app);
}

.data-table td {
  padding: 14px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

/* Badges e Status */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.active {
  background-color: var(--emerald-50);
  color: var(--emerald-600);
}

.status-badge.inactive {
  background-color: var(--red-50);
  color: var(--red-600);
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--wiser-50);
  color: var(--wiser-700);
  border: 1px solid var(--wiser-200);
}

.dark .plan-badge {
  background-color: rgba(14, 165, 233, 0.2);
  color: var(--wiser-300);
  border-color: var(--wiser-800);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ==========================================
   FILTROS DE AUDITORIA
   ========================================== */

.audit-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-body .filter-group { margin-bottom: 14px; }

.form-control, .select-control {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .select-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* ==========================================
   TELA DE LOGIN (WISER ACADEMY FIDELITY)
   ========================================== */

.login-fullscreen {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #e8f4fc;
  background-image: radial-gradient(ellipse at top, #f0f9ff 0%, #e2eef8 55%, #dbeafe 100%);
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.dark .login-fullscreen,
[data-theme='dark'] .login-fullscreen {
  background-color: #0b1320;
  background-image: none;
}

#neuralCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Botão de Tema no Topo Direito */
.login-theme-toggle {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 50;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #cbd5e1;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  transition: all 0.2s ease;
}

.login-theme-toggle:hover {
  background: #ffffff;
  border-color: #0ea5e9;
  color: #0284c7;
  transform: scale(1.08);
}

.dark .login-theme-toggle,
[data-theme='dark'] .login-theme-toggle {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(71, 85, 105, 0.6);
  color: #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.dark .login-theme-toggle:hover,
[data-theme='dark'] .login-theme-toggle:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #0ea5e9;
  color: #38bdf8;
}

.login-container-wrap {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 380px;
}

.login-brand-block {
  text-align: center;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.login-logo-symbol {
  height: 58px;
  width: auto;
  object-fit: contain;
}

.dark .login-logo-symbol,
[data-theme='dark'] .login-logo-symbol {
  filter: drop-shadow(0 0 10px rgba(14, 165, 233, 0.35)) brightness(1.1);
}

.login-brand-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.dark .login-brand-title,
[data-theme='dark'] .login-brand-title {
  color: #ffffff;
}

.login-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 30px 26px;
  box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.18), 0 0 1px 1px rgba(255, 255, 255, 0.6);
  animation: slideUp 0.3s ease-out;
}

.dark .login-card,
[data-theme='dark'] .login-card {
  background: rgba(22, 33, 49, 0.92);
  border: 1px solid rgba(51, 65, 85, 0.85);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.05);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-form .filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form .filter-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 2px;
}

.dark .login-form .filter-group label,
[data-theme='dark'] .login-form .filter-group label {
  color: #94a3b8;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

.login-fullscreen .input-with-icon input.form-control {
  width: 100% !important;
  background-color: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  padding: 12px 42px 12px 42px !important;
  border-radius: 8px !important;
  font-size: 0.9rem !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease;
}

.login-fullscreen .input-with-icon input.form-control:focus {
  background-color: #ffffff !important;
  border-color: #0ea5e9 !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2) !important;
}

.dark .login-fullscreen .input-with-icon input.form-control,
[data-theme='dark'] .login-fullscreen .input-with-icon input.form-control {
  background-color: #1e2c3f !important;
  border: 1px solid #334155 !important;
  color: #f8fafc !important;
}

.dark .login-fullscreen .input-with-icon input.form-control:focus,
[data-theme='dark'] .login-fullscreen .input-with-icon input.form-control:focus {
  background-color: #24354c !important;
  border-color: #0ea5e9 !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25) !important;
}

.input-with-icon .password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  z-index: 5;
  transition: color 0.15s;
}

.input-with-icon .password-toggle-btn:hover {
  color: #0284c7;
}

.dark .input-with-icon .password-toggle-btn,
[data-theme='dark'] .input-with-icon .password-toggle-btn {
  color: #94a3b8;
}

.dark .input-with-icon .password-toggle-btn:hover,
[data-theme='dark'] .input-with-icon .password-toggle-btn:hover {
  color: #38bdf8;
}

.password-generate-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.password-generate-row .form-control {
  flex: 1;
  min-width: 0;
}

.password-generate-row .password-toggle-inline {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--border-color, #334155);
  border-radius: 8px;
  background: transparent;
}

.btn-login-entrar {
  width: 100%;
  padding: 12px;
  background-color: #0284c7;
  background-image: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
  transition: all 0.2s ease;
  margin-top: 6px;
}

.btn-login-entrar:hover {
  background-image: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.55);
}

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

.login-sso {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.btn-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
}
.btn-sso:hover { border-color: #0ea5e9; color: #0284c7; }

.dark .btn-sso,
[data-theme='dark'] .btn-sso {
  border: 1px solid #475569;
  background: rgba(15, 23, 42, 0.55);
  color: #f8fafc;
}
.dark .btn-sso:hover,
[data-theme='dark'] .btn-sso:hover {
  border-color: #38bdf8;
  color: #ffffff;
}
.sso-icon { width: 18px; height: 18px; flex-shrink: 0; }

.login-help-btn {
  margin-top: 22px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #cbd5e1;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-help-btn:hover {
  background: #ffffff;
  color: #0284c7;
  border-color: #0ea5e9;
  transform: scale(1.06);
}

.dark .login-help-btn,
[data-theme='dark'] .login-help-btn {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(71, 85, 105, 0.6);
  color: #94a3b8;
}

.dark .login-help-btn:hover,
[data-theme='dark'] .login-help-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #ffffff;
  border-color: #0ea5e9;
}

.login-demo-popover {
  display: none;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  animation: fadeIn 0.2s ease-out;
}

.login-demo-popover.show {
  display: block;
}

.dark .login-demo-popover,
[data-theme='dark'] .login-demo-popover {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid #334155;
  color: #94a3b8;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* ==========================================
   MODAIS E OVERLAYS
   ========================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: slideUp 0.25s ease-out;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: var(--bg-app);
}

/* ==========================================
   MEU PERFIL
   ========================================== */

.profile-card-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--wiser-50) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 24px;
}

.dark .profile-card-hero {
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(14, 165, 233, 0.1) 100%);
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wiser-500), var(--wiser-700));
  color: white;
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  border: 3px solid var(--bg-surface);
  overflow: hidden;
}

.profile-meta-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-meta-name {
  font-family: 'Sora', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-meta-email {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

/* ==========================================
   ANIMAÇÕES & KEYFRAMES
   ========================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Scrollbar Personalizada */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
}

/* Utilidades */
.hidden { display: none !important; }
.text-right { text-align: right; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.mt-4 { margin-top: 16px; }

button.ch-nav-item,
.ch-nav-item {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  margin: 0 0 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  cursor: pointer;
}

.ch-nav-item.child {
  margin-left: 10px;
  width: calc(100% - 10px);
  padding-left: 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background-color: var(--bg-input);
}

.ch-nav-item:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.dark .ch-nav-item,
[data-theme='dark'] .ch-nav-item {
  background-color: #1e293b;
  color: #f8fafc;
  border-color: #475569;
}

.dark .ch-nav-item.child,
[data-theme='dark'] .ch-nav-item.child {
  background-color: #0f172a;
  color: #e2e8f0;
}

#chSourceForm label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.obs-chip {
  display: inline-block;
  font-family: monospace;
  font-size: 0.8rem;
  background-color: var(--wiser-100);
  color: var(--wiser-800);
  padding: 2px 8px;
  border-radius: 4px;
}

.dark .obs-chip,
[data-theme='dark'] .obs-chip {
  background-color: rgba(56, 189, 248, 0.18);
  color: var(--wiser-300);
}

.col-filter {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-primary);
}

.row-click { cursor: pointer; }
.row-click:hover td { background: rgba(2, 132, 199, 0.08); }

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--wiser-600);
  text-transform: uppercase;
}
.kpi-value { font-size: 1.6rem; font-weight: 800; margin-top: 4px; }

.chat-layout { display: flex; height: calc(100vh - 72px); width: 100%; background: var(--bg-app); }
.chat-rail {
  width: 260px;
  border-right: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 12px;
  overflow: auto;
}
.chat-rail-head { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-bottom: 12px; }
.chat-new-btn { width: 100%; padding: 10px 12px; font-size: 0.9rem; }
.chat-thread { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.chat-thread.active .chat-thread-open {
  background: #0ea5e9;
  color: #ffffff;
  font-weight: 600;
}
html.dark .chat-thread.active .chat-thread-open,
[data-theme="dark"] .chat-thread.active .chat-thread-open {
  background: #0369a1;
  color: #f8fafc;
}
.chat-thread-open {
  flex: 1;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
}
.chat-thread-actions { display: flex; align-items: center; gap: 2px; }
.chat-thread-actions .btn-icon-action {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}
.chat-thread-actions .btn-icon-action .lucide-icon { width: 16px; height: 16px; }
.chat-thread-actions .btn-icon-action.delete:hover { color: var(--red-600); }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg-surface); }
.chat-top {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.chat-llm-inactive-banner {
  padding: 10px 20px;
  background: #fef3c7;
  border-bottom: 1px solid #fcd34d;
  color: #92400e;
  font-size: 0.82rem;
  line-height: 1.5;
}
html.dark .chat-llm-inactive-banner,
[data-theme="dark"] .chat-llm-inactive-banner {
  background: rgba(245, 158, 11, 0.15);
  border-bottom-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}
.chat-llm-inactive-banner__inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 960px;
}
.chat-llm-inactive-banner__inner .lucide-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.chat-quick { padding: 8px 20px; display: flex; gap: 8px; overflow-x: auto; border-top: 1px solid var(--border-color); }
.chat-pill { font-size: 0.75rem; padding: 4px 10px; border-radius: 14px; white-space: nowrap; }
.chat-input { padding: 16px 20px; display: flex; gap: 10px; border-top: 1px solid var(--border-color); }
.chat-bubble-row { display: flex; gap: 12px; max-width: 85%; }
.chat-bubble-row.me { align-self: flex-end; }
.chat-bubble-row.bot { align-self: flex-start; }
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--wiser-600), #8b5cf6);
  color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chat-bubble {
  background: var(--bg-app);
  color: var(--text-primary);
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}
.chat-bubble.me { background: var(--wiser-600); color: #fff; border-color: transparent; }
.chat-time { font-size: 0.68rem; margin-top: 6px; text-align: right; color: var(--text-muted); }
.chat-bubble.me .chat-time { color: rgba(255,255,255,0.75); }
.chat-msg-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.chat-chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  margin-top: 8px;
}
.chat-chart-wrap canvas { display: block; width: 100% !important; height: 100% !important; }
.chat-bubble.bi { max-width: min(920px, 100%); width: min(920px, 100%); }
.bi-answer { font-size: 0.88rem; line-height: 1.55; margin-bottom: 10px; }
.bi-card {
  margin-top: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}
.bi-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px 8px;
  flex-wrap: wrap;
}
.bi-card-head h3 { margin: 0; font-size: 1rem; }
.bi-insight { margin: 6px 0 0; color: var(--text-secondary); font-size: 0.82rem; }
.bi-toolbar { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.bi-toolbar label { font-size: 0.72rem; color: var(--text-muted); display: grid; gap: 4px; }
.bi-toolbar .select-control { min-width: 120px; }
.bi-tabs {
  display: flex;
  gap: 4px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-color);
}
.bi-tabs button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
}
.bi-tabs button.active {
  color: var(--wiser-600);
  border-bottom-color: var(--wiser-600);
}
.bi-panel { padding: 8px 12px 16px; }
.bi-sql {
  margin: 0;
  padding: 12px;
  background: var(--bg-app);
  border-radius: 8px;
  font-size: 0.78rem;
  overflow: auto;
}

.db-layers { display: grid; gap: 16px; }
.db-layer {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.db-layer header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.db-layer h2 { margin: 0 0 4px; }
.db-layer p { margin: 6px 0 0; color: var(--text-muted); }
.db-ouro { border-top: 4px solid #d4af37; }
.db-prata { border-top: 4px solid #94a3b8; }
.db-bronze { border-top: 4px solid #b45309; }

.topo-stage { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 16px; min-height: 500px; overflow: hidden; }
.topo-svg { width: 100%; height: 500px; }
.topo-edge { stroke: #64748b; stroke-width: 1.5; opacity: 0.35; }
.topo-edge.live { stroke: var(--amber-600); opacity: 0.9; stroke-dasharray: 8 10; animation: topoFlow 1.6s linear infinite; }
.topo-edge.down { stroke: #64748b; opacity: 0.25; }
.topo-node circle { fill: #334155; stroke: #94a3b8; stroke-width: 2; }
.topo-node.ok circle { fill: #059669; stroke: #6ee7b7; animation: topoPulse 2.4s ease-in-out infinite; }
.topo-node.off circle { fill: #475569; stroke: #94a3b8; }
.topo-node text { fill: var(--text-secondary); font-size: 11px; font-family: Outfit, sans-serif; }
.topo-legend { display: flex; gap: 16px; padding: 8px 16px 16px; font-size: 0.8rem; color: var(--text-muted); }
.topo-legend .on::before, .topo-chip.on::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #10b981; margin-right: 6px; }
.topo-legend .off::before, .topo-chip.off::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #64748b; margin-right: 6px; }
.topo-chip { display: inline-block; margin: 0 8px 8px 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-color); font-size: 0.82rem; }

@keyframes topoFlow { to { stroke-dashoffset: -36; } }
@keyframes topoPulse { 50% { r: 20; } }

.train-card, .train-lesson, .train-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px 26px;
  margin: 0 0 20px;
}
.train-card {
  display: flex;
  gap: 16px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.train-card-link {
  display: flex;
  gap: 16px;
  align-items: center;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.train-exam-gate {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.train-exam-gate p { margin: 0 0 14px; line-height: 1.5; }
.train-form-stack { display: flex; flex-direction: column; gap: 18px; }
.train-form-stack .btn-primary, .train-form-stack .btn-secondary { align-self: flex-start; }
.train-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.train-stack { display: flex; flex-direction: column; gap: 20px; }
.train-stack .train-panel { margin-bottom: 0; }
.train-dash { display: flex; flex-direction: column; gap: 28px; }
.train-dash > .page-header-block,
.train-dash > .train-kpis,
.train-dash > .train-two,
.train-dash > .train-panel { margin-bottom: 0; }
.train-rank {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}
.train-rank li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}
.train-rank li:last-child { border-bottom: none; }
.train-rank-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.train-rank em { font-style: normal; color: var(--text-muted); font-size: 0.82rem; }
.train-rank-company { font-weight: 400; font-size: 0.85rem; color: var(--text-muted); }
.train-podium-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.train-podium {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.08);
}
.train-podium.p1 { background: rgba(245, 158, 11, 0.16); }
.train-podium.p2 { background: rgba(148, 163, 184, 0.16); }
.train-podium.p3 { background: rgba(180, 83, 9, 0.16); }
.train-podium-pos { width: 2rem; flex-shrink: 0; font-weight: 700; }
.train-podium-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.train-podium-meta { margin-left: auto; flex-shrink: 0; font-size: 0.85rem; color: var(--text-muted); }
.train-chip-row { display: flex; flex-wrap: wrap; gap: 12px; }
.train-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.25);
}
.train-chip.gold {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.28);
}
.train-chip-ico {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(14, 165, 233, 0.16); color: #38bdf8; flex-shrink: 0;
}
.train-chip strong { display: block; font-size: 0.92rem; }
.train-chip em { display: block; font-style: normal; font-size: 0.75rem; color: var(--text-muted); }
.train-stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px 18px;
  position: relative;
  overflow: hidden;
}
.train-stat-body { flex: 1; min-width: 0; }
.train-stat .train-bar { margin: 8px 0 6px; }
.train-stat::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.train-stat-blue::before { background: #0ea5e9; }
.train-stat-purple::before { background: #8b5cf6; }
.train-stat-green::before { background: #10b981; }
.train-stat-amber::before { background: #f59e0b; }
.train-stat-ico {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.train-stat-blue .train-stat-ico { background: rgba(14, 165, 233, 0.14); color: #38bdf8; }
.train-stat-purple .train-stat-ico { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; }
.train-stat-green .train-stat-ico { background: rgba(16, 185, 129, 0.14); color: #34d399; }
.train-stat-amber .train-stat-ico { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.train-stat .kpi-label { margin-bottom: 6px; }
.train-stat .kpi-value { margin: 12px 0 4px; font-size: 1.6rem; font-weight: 800; }
.train-stat-label { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.train-stat .train-meta { margin: 0; }
.train-card.static { cursor: default; }
.train-card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--wiser-50); color: var(--wiser-600);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.train-card-body { flex: 1; min-width: 0; }
.train-card-body h2, .train-panel h2 { margin: 0 0 12px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.train-card-body p, .train-lesson p { margin: 0 0 12px; color: var(--text-secondary); line-height: 1.5; }
.train-meta { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 10px; }
.train-bar { height: 8px; background: var(--border-color); border-radius: 99px; overflow: hidden; }
.train-bar span { display: block; height: 100%; background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.train-lesson.done { border-color: #059669; }
.train-done { background: rgba(5, 150, 105, 0.12); color: #059669; padding: 12px 14px; border-radius: 10px; }
.train-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.train-tiles { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.train-tile {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid rgba(56, 189, 248, 0.35); border-radius: 999px;
  color: inherit; text-decoration: none; max-width: 280px;
  background: rgba(14, 165, 233, 0.08); cursor: pointer; font: inherit; text-align: left;
}
.train-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.train-panel > .train-row { margin-bottom: 14px; }
.train-two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
.train-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.train-chart {
  position: relative;
  height: 256px;
  width: 100%;
}
.train-chart-empty {
  height: 256px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  text-align: center;
}
.train-chart-empty p { margin: 0; }
.badge-success { background: rgba(34, 197, 94, 0.15); color: #16a34a; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; }
.llm-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.llm-tab-btn { border: 1px solid var(--border-color); background: transparent; color: var(--text-muted); padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.llm-tab-btn.is-active { border-color: var(--wiser-600, #2563eb); color: var(--text-primary); background: rgba(37, 99, 235, 0.08); }
.llm-binding-card { margin-bottom: 16px; }
.llm-red-opt { display: block; margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(239, 68, 68, 0.35); border-radius: 8px; background: rgba(239, 68, 68, 0.06); color: var(--text-primary); cursor: pointer; }
.llm-red-opt.is-on { border-color: #ef4444; background: rgba(239, 68, 68, 0.12); }
.llm-red-opt input { margin-right: 8px; }
.train-option input { margin-right: 8px; vertical-align: middle; }
.train-option.is-disabled { opacity: 0.55; cursor: not-allowed; }
.train-option:has(input:checked) { border-color: var(--wiser-600, #2563eb); }
.license-contract { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.train-badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.train-badge-summary { grid-column: 1 / -1; margin: 0 0 6px; color: var(--text-secondary); }
.train-badge {
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
  background: var(--bg-surface);
  position: relative;
  overflow: hidden;
}
.train-badge h3 { margin: 0; font-size: 1.08rem; }
.train-badge p { margin: 0; color: var(--text-secondary); line-height: 1.5; flex: 1; }
.train-badge-ico {
  width: 56px; height: 56px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(148, 163, 184, 0.12); color: var(--text-muted);
}
.train-badge-ico .lucide-icon { width: 28px; height: 28px; }
.train-badge.on { box-shadow: 0 10px 28px rgba(14, 165, 233, 0.08); }
.train-badge.off { opacity: 0.78; }
.train-badge.off .train-badge-ico { background: rgba(15, 23, 42, 0.45); }
.train-badge-primeiro_acesso.on { border-color: #38bdf8; }
.train-badge-primeiro_acesso.on .train-badge-ico { background: rgba(14, 165, 233, 0.18); color: #38bdf8; }
.train-badge-primeira_licao.on { border-color: #818cf8; }
.train-badge-primeira_licao.on .train-badge-ico { background: rgba(129, 140, 248, 0.18); color: #a5b4fc; }
.train-badge-primeiro_quiz.on { border-color: #c084fc; }
.train-badge-primeiro_quiz.on .train-badge-ico { background: rgba(192, 132, 252, 0.18); color: #d8b4fe; }
.train-badge-especialista.on { border-color: #34d399; }
.train-badge-especialista.on .train-badge-ico { background: rgba(52, 211, 153, 0.18); color: #6ee7b7; }
.train-badge-mestre_trilha.on { border-color: #fbbf24; }
.train-badge-mestre_trilha.on .train-badge-ico { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.train-badge-certificado.on { border-color: #fb923c; }
.train-badge-certificado.on .train-badge-ico { background: rgba(251, 146, 60, 0.18); color: #fdba74; }
.train-badge-pts {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(14, 165, 233, 0.12); color: var(--wiser-500, #38bdf8);
  font-size: 0.78rem; font-weight: 700;
}
.train-quiz { display: flex; flex-direction: column; gap: 16px; }
.train-quiz .btn-primary { align-self: flex-start; margin-top: 4px; }
.train-ok { color: #34d399; font-weight: 600; }
.train-muted, .train-error { color: var(--text-muted); }
.train-panel > .train-muted, .train-panel > p { margin: 0 0 12px; line-height: 1.5; }
.train-error { color: var(--red-600, #dc2626); }
.train-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.train-q { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-surface); color: inherit; }
.train-q.on { background: var(--wiser-600); color: #fff; border-color: var(--wiser-600); }
.train-chevron { color: var(--text-muted); }

.train-acc {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin: 0 0 16px;
  overflow: hidden;
}
.train-acc > summary {
  list-style: none;
  cursor: pointer;
}
.train-acc > summary::-webkit-details-marker { display: none; }
.train-acc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  min-height: 68px;
}
.train-acc-head:hover {
  background: rgba(14, 165, 233, 0.06);
}
.train-acc-chevron {
  color: var(--text-muted);
  display: inline-flex;
  transition: transform 0.15s ease;
}
.train-acc[open] > summary .train-acc-chevron { transform: rotate(90deg); }
.train-acc-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.12);
  color: var(--wiser-400, var(--wiser-600));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.train-acc-ico-quiz {
  background: rgba(139, 92, 246, 0.16);
  color: #a78bfa;
}
.train-acc-title {
  flex: 1;
  font-weight: 600;
  min-width: 0;
}
.train-acc-actions {
  display: inline-flex;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}
.train-acc-body {
  padding: 4px 18px 18px 60px;
}
.train-item,
.train-option-row,
.train-q-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.train-item {
  padding: 10px 0;
  border-top: 1px solid var(--border-color);
}
.train-item-title { flex: 1; min-width: 0; }
.train-q-block {
  padding: 14px 0;
  border-top: 1px solid var(--border-color);
}
.train-q-head { margin-bottom: 6px; align-items: flex-start; }
.train-option-row {
  padding: 6px 0 6px 8px;
  color: var(--text-secondary);
}
.train-add-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 4px;
  background: none;
  border: none;
  color: var(--wiser-400, var(--wiser-600));
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.train-add-link:hover { color: var(--wiser-300, var(--wiser-500)); }
.train-support-block { margin-top: 12px; }
.train-support-block h3 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.train-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
}
.train-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.85rem;
}
.train-file:hover .train-file-btn {
  border-color: var(--wiser-500);
  color: var(--wiser-500);
}
.train-file-name { color: var(--text-muted); font-size: 0.82rem; }
.train-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.train-upload .form-control { max-width: 280px; }

.train-acc-head .train-meta { margin-bottom: 0; }

@media (max-width: 900px) {
  .train-two, .train-kpis, .train-badge-grid, .train-form-grid { grid-template-columns: 1fr; }
  .train-acc-body { padding-left: 16px; }
}

@media (max-width: 900px) {
  .chat-layout { flex-direction: column; height: auto; }
  .chat-rail { width: 100%; max-height: 180px; border-right: 0; border-bottom: 1px solid var(--border-color); }
}

