/* ==========================================================================
   SISTEMA DE DESIGN CORPORATIVO & RESPONSIVO • SENAI DF
   Matriz de Responsabilidades do Portfólio de Cursos
   Otimizado para: Mobile Pequeno (320px), Smartphone (480px),
   Tablet (768px), Laptop (1024px) e Monitores Ultra-Wide (>1440px)
   ========================================================================== */

:root {
  /* Paleta Oficial SENAI DF & Sistema FIBRA */
  --senai-blue-primary: #004587;
  --senai-blue-dark: #002d5a;
  --senai-blue-deep: #001e3d;
  --senai-blue-light: #0066b3;
  --senai-cyan: #00a3e0;
  --senai-cyan-soft: #e0f2fe;
  
  /* Cores de Acento e Setores */
  --setor-educacao: #0284c7;
  --setor-educacao-bg: #f0f9ff;
  --setor-educacao-border: #bae6fd;
  
  --setor-comunicacao: #0d9488;
  --setor-comunicacao-bg: #f0fdfa;
  --setor-comunicacao-border: #99f6e4;
  
  --setor-ti: #6366f1;
  --setor-ti-bg: #eef2ff;
  --setor-ti-border: #c7d2fe;

  /* Cores RACI */
  --raci-responsavel-bg: #004587;
  --raci-responsavel-text: #ffffff;
  --raci-apoio-bg: #0284c7;
  --raci-apoio-text: #ffffff;
  --raci-informado-bg: #64748b;
  --raci-informado-text: #ffffff;

  /* Níveis de Prioridade */
  --prio-urgente: #dc2626;
  --prio-urgente-bg: #fef2f2;
  --prio-alta: #ea580c;
  --prio-alta-bg: #fff7ed;
  --prio-media: #0284c7;
  --prio-media-bg: #f0f9ff;
  --prio-planejada: #16a34a;
  --prio-planejada-bg: #f0fdf4;

  /* Tons Neutros e Superfícies (Tema Claro Padrão) */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #0066b3;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  /* Sombras e Elevações Suaves */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Dimensões & Raios */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Transições Fluídas */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Fontes */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;

  /* Área Mínima de Toque Móvel (Acessibilidade Mobile) */
  --touch-target-min: 44px;
}

/* Modo Escuro Sofisticado */
[data-theme="dark"] {
  --bg-body: #0b1120;
  --bg-card: #131c31;
  --bg-card-subtle: #1e293b;
  --bg-hover: #1e293b;
  --border-color: #334155;
  --border-focus: #38bdf8;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --senai-blue-primary: #1e40af;
  --senai-blue-light: #3b82f6;
  --senai-cyan-soft: #0c4a6e;

  --setor-educacao-bg: rgba(12, 74, 110, 0.2);
  --setor-comunicacao-bg: rgba(19, 78, 74, 0.2);
  --setor-ti-bg: rgba(49, 46, 129, 0.2);

  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
}

/* Reset Global e Tipografia Fluida */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* Container Principal com Padding Responsivo */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(0.75rem, 3vw, 1.75rem);
  width: 100%;
}

/* ==========================================================================
   TOPBAR & HEADER INSTITUCIONAL (RESPONSIVO)
   ========================================================================== */
.topbar {
  background: linear-gradient(135deg, var(--senai-blue-deep) 0%, var(--senai-blue-primary) 100%);
  color: #ffffff;
  padding: 0.65rem 0;
  border-bottom: 2px solid var(--senai-cyan);
  font-size: 0.85rem;
}

.topbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.topbar-branding {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  flex: 1 1 auto;
}

.senai-logo-container {
  background-color: #ffffff;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.senai-logo-container:hover {
  transform: scale(1.02);
}

.senai-logo-img {
  height: 24px;
  width: auto;
  display: block;
  object-fit: contain;
}

.senai-logo-container.footer-logo {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border-color);
  background-color: #ffffff;
}

.senai-logo-container.footer-logo .senai-logo-img {
  height: 20px;
}

.senai-logo-pill {
  background-color: #ffffff;
  color: var(--senai-blue-primary);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.8px;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.topbar-title-text {
  font-size: 0.82rem;
  font-weight: 600;
}

.topbar-badge {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.target-portal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 163, 224, 0.2);
  color: #e0f2fe;
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(0, 163, 224, 0.4);
  transition: all var(--transition-fast);
  min-height: 34px;
}

.target-portal-link:hover {
  background: rgba(0, 163, 224, 0.35);
  color: #ffffff;
  transform: translateY(-1px);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse-green 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.btn-icon-top {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  min-height: 34px;
}

.btn-icon-top:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Ajustes da Topbar para Mobile */
@media (max-width: 640px) {
  .topbar {
    padding: 0.5rem 0;
  }
  .topbar-content {
    justify-content: center;
    text-align: center;
  }
  .topbar-branding {
    justify-content: center;
    width: 100%;
  }
  .topbar-title-text {
    display: inline-block;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
  }
  .topbar-actions {
    justify-content: center;
    width: 100%;
    gap: 0.4rem;
  }
  .btn-icon-top span,
  .target-portal-link span:not(.pulse-dot) {
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   HERO BANNER & RESUMO EXECUTIVO (RESPONSIVO)
   ========================================================================== */
.hero-header {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-body) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: clamp(1.5rem, 4vw, 2.75rem) 0 clamp(1.25rem, 3vw, 2rem);
  position: relative;
  overflow: hidden;
}

.hero-header::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 500px;
  height: 100%;
  background: radial-gradient(circle at 80% 20%, rgba(0, 163, 224, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
}

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--senai-blue-light);
  font-weight: 700;
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.4rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3.2vw, 2.4rem);
  font-weight: 800;
  color: var(--senai-blue-primary);
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 0.65rem;
}

[data-theme="dark"] .hero-title {
  color: #ffffff;
}

.hero-subtitle {
  font-size: clamp(0.88rem, 2vw, 1.05rem);
  color: var(--text-secondary);
  max-width: 800px;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.hero-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.meta-chip {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: clamp(0.72rem, 1.8vw, 0.82rem);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
  font-weight: 500;
  max-width: 100%;
  word-break: break-word;
}

.meta-chip strong {
  color: var(--senai-blue-light);
}

/* KPIs em Grid Fluido */
.hero-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  min-width: 280px;
}

@media (max-width: 480px) {
  .hero-kpis {
    grid-template-columns: repeat(2, 1fr);
    min-width: 100%;
    gap: 0.5rem;
  }
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: clamp(0.75rem, 2vw, 1.1rem);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--senai-cyan);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 800;
  color: var(--senai-blue-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

[data-theme="dark"] .kpi-value {
  color: var(--senai-cyan);
}

.kpi-label {
  font-size: clamp(0.65rem, 1.6vw, 0.75rem);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

/* ==========================================================================
   NAVEGAÇÃO POR ABAS (TABS RESPONSIVAS COM FADE DE SCROLL)
   ========================================================================== */
.tabs-wrapper {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-xs);
}

.tabs-scroll-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.nav-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  font-weight: 600;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  transition: all var(--transition-fast);
  scroll-snap-align: start;
  min-height: var(--touch-target-min);
  flex-shrink: 0;
}

.tab-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.tab-btn:hover {
  background-color: var(--bg-card-subtle);
  color: var(--text-primary);
}

.tab-btn.active {
  background-color: var(--senai-blue-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.tab-btn.active svg {
  transform: scale(1.1);
}

.tab-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.tab-btn:not(.active) .tab-badge {
  background-color: var(--bg-card-subtle);
  color: var(--text-secondary);
}

/* Indicador de rolagem nas abas para mobile */
@media (max-width: 768px) {
  .tabs-scroll-container::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 24px;
    background: linear-gradient(90deg, transparent, var(--bg-card));
    pointer-events: none;
  }
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL & SEÇÕES DAS ABAS
   ========================================================================== */
.main-content {
  flex: 1;
  padding: clamp(1.25rem, 3vw, 2.25rem) 0 clamp(2rem, 4vw, 3.5rem);
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-pane.active {
  display: block;
}

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

/* Cabeçalho da Seção */
.section-intro {
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2.5vw, 1.75rem);
  box-shadow: var(--shadow-sm);
}

.section-number-tag {
  display: inline-block;
  background-color: var(--senai-blue-primary);
  color: #ffffff;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.78rem;
  margin-bottom: 0.4rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.section-desc {
  color: var(--text-secondary);
  font-size: clamp(0.85rem, 1.8vw, 0.98rem);
  max-width: 1000px;
  line-height: 1.55;
}

/* ==========================================================================
   ABA 1: MATRIZ RACI COMPLETA (BARRA DE FILTROS RESPONSIVA & REDESENHADA)
   ========================================================================== */
.toolbar-controls {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: clamp(0.85rem, 2.5vw, 1.25rem);
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

/* Linha Superior: Busca + Alternador + Contador */
.toolbar-top-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 2.6rem;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background-color: var(--bg-card-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
  min-height: var(--touch-target-min);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(0, 102, 179, 0.15);
}

.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.btn-clear-search {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-clear-search:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.toolbar-actions-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.results-counter-pill {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.results-counter-pill span {
  color: var(--senai-blue-primary);
  font-weight: 800;
}

[data-theme="dark"] .results-counter-pill span {
  color: var(--senai-cyan);
}

.view-toggle-group {
  display: flex;
  align-items: center;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.2rem;
  flex-shrink: 0;
}

.view-btn {
  background: transparent;
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
  min-height: 34px;
}

.view-btn.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

/* Container de Trilhos de Filtros (Eixo e Setor) */
.filters-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.filter-rail-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
}

.filter-rail-header {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 82px;
  flex-shrink: 0;
  letter-spacing: 0.4px;
}

.filter-chips-rail {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  width: 100%;
}

.filter-chip {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: clamp(0.75rem, 1.8vw, 0.82rem);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  user-select: none;
}

.filter-chip:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.filter-chip:active {
  transform: scale(0.96);
}

.filter-chip.active {
  background-color: var(--senai-blue-primary);
  color: #ffffff;
  border-color: var(--senai-blue-primary);
  box-shadow: 0 1px 3px rgba(0, 69, 135, 0.3);
}

/* Pontinhos Coloridos nos Chips */
.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot-educacao { background-color: var(--setor-educacao); }
.dot-comunicacao { background-color: var(--setor-comunicacao); }
.dot-ti { background-color: var(--setor-ti); }

.filter-chip.active .chip-dot {
  background-color: #ffffff;
}

.btn-reset-filters {
  background-color: rgba(220, 38, 38, 0.1) !important;
  color: var(--prio-urgente) !important;
  border-color: rgba(220, 38, 38, 0.25) !important;
}

.btn-reset-filters:hover {
  background-color: var(--prio-urgente) !important;
  color: #ffffff !important;
}

/* ==========================================================================
   MELHORIAS ESPECÍFICAS PARA MOBILE (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .toolbar-top-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .toolbar-actions-right {
    justify-content: space-between;
    width: 100%;
  }

  .view-toggle-group {
    flex: 0 0 auto;
  }

  /* No celular, os chips viram trilhos com scroll horizontal suave com snap */
  .filter-rail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .filter-rail-header {
    min-width: unset;
  }

  .filter-chips-rail {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    padding: 0.15rem 0 0.35rem 0;
    width: 100%;
  }

  .filter-chips-rail::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

/* Legenda RACI Rápida */
.raci-legend-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Badges RACI */
.raci-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: clamp(0.7rem, 1.6vw, 0.78rem);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.raci-badge.responsavel {
  background-color: var(--raci-responsavel-bg);
  color: var(--raci-responsavel-text);
  box-shadow: 0 1px 3px rgba(0, 69, 135, 0.25);
}

.raci-badge.apoio,
.raci-badge.validacao {
  background-color: var(--raci-apoio-bg);
  color: var(--raci-apoio-text);
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.25);
}

.raci-badge.informado {
  background-color: var(--raci-informado-bg);
  color: var(--raci-informado-text);
}

/* Indicador de Swipe para Tabela no Mobile */
.mobile-swipe-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--senai-blue-light);
  background-color: var(--bg-card-subtle);
  padding: 0.45rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
}

@media (max-width: 900px) {
  .mobile-swipe-hint {
    display: flex;
  }
}

/* TABELA RACI INSTITUCIONAL COM SCROLL HORIZONTAL SUAVE */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.raci-table {
  width: 100%;
  min-width: 680px; /* Garante que as colunas não fiquem esmagadas no mobile */
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.raci-table thead th {
  background-color: var(--senai-blue-primary);
  color: #ffffff;
  padding: 0.85rem 1rem;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--senai-cyan);
  white-space: nowrap;
}

.raci-table thead th.col-center {
  text-align: center;
}

.raci-table tbody tr.eixo-header-row td {
  background: linear-gradient(90deg, var(--bg-card-subtle) 0%, var(--bg-card) 100%);
  padding: 0.8rem 1rem;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--senai-blue-primary);
  border-top: 2px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .raci-table tbody tr.eixo-header-row td {
  color: var(--senai-cyan);
}

.raci-table tbody tr.task-row {
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-fast);
}

.raci-table tbody tr.task-row:hover {
  background-color: var(--bg-hover);
}

.raci-table tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
}

.task-id-badge {
  font-weight: 800;
  color: var(--senai-blue-primary);
  background-color: var(--bg-card-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  border: 1px solid var(--border-color);
  display: inline-block;
  white-space: nowrap;
}

.task-info-cell {
  min-width: 200px;
  max-width: 380px;
}

.task-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
  cursor: pointer;
  line-height: 1.35;
}

.task-title:hover {
  color: var(--senai-blue-light);
  text-decoration: underline;
}

.task-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.delivery-cell {
  background-color: var(--bg-card-subtle);
  border-left: 3px solid var(--senai-cyan);
  padding: 0.75rem 0.9rem !important;
  font-size: 0.82rem;
  color: var(--text-primary);
  min-width: 220px;
  max-width: 320px;
  line-height: 1.45;
}

.delivery-cell strong {
  display: block;
  font-size: 0.72rem;
  color: var(--senai-blue-primary);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

[data-theme="dark"] .delivery-cell strong {
  color: var(--senai-cyan);
}

/* VISUALIZAÇÃO EM CARDS POR EIXO (GRID RESPONSIVO) */
.cards-view-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.eixo-card-group {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2.5vw, 1.5rem);
  box-shadow: var(--shadow-sm);
}

.eixo-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.eixo-group-title {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.2vw, 1.25rem);
  font-weight: 700;
  color: var(--text-primary);
}

.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1rem;
}

.task-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--senai-cyan);
}

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.65rem;
}

.task-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.task-card-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  line-height: 1.45;
}

.task-card-raci-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  text-align: center;
}

.raci-mini-col {
  background-color: var(--bg-card-subtle);
  padding: 0.35rem 0.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.raci-mini-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
}

.task-card-delivery {
  background-color: var(--bg-card-subtle);
  border-left: 3px solid var(--senai-blue-primary);
  padding: 0.6rem 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8rem;
  color: var(--text-primary);
  line-height: 1.45;
}

/* ==========================================================================
   ABA 2: CICLO EM 4 ETAPAS (TIMELINE RESPONSIVA & MOBILE ADAPTIVA)
   ========================================================================== */
.ciclo-flow-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pipeline-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  position: relative;
}

@media (max-width: 1024px) {
  .pipeline-stepper {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  /* No smartphone, o ciclo vira uma esteira vertical conectada */
  .pipeline-stepper {
    grid-template-columns: 1fr;
    position: relative;
    padding-left: 1.75rem;
  }

  .pipeline-stepper::before {
    content: "";
    position: absolute;
    top: 24px;
    bottom: 24px;
    left: 19px;
    width: 3px;
    background: linear-gradient(180deg, var(--senai-blue-primary), var(--senai-cyan));
    border-radius: var(--radius-full);
  }
}

.pipeline-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2.5vw, 1.4rem);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--transition-fast);
}

.pipeline-step-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--senai-blue-primary);
}

.step-number-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--senai-blue-primary), var(--senai-blue-light));
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .step-number-circle {
    position: absolute;
    left: -2.35rem;
    top: 1rem;
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
    border: 3px solid var(--bg-body);
  }
}

.step-card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--senai-blue-light);
  letter-spacing: 0.4px;
  margin-bottom: 0.2rem;
}

.step-card-title {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 2vw, 1.15rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

.step-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.85rem;
  flex: 1;
}

.step-card-footer {
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   ABA 3: OS 3 SETORES & ATRIBUIÇÕES (RESPONSIVO)
   ========================================================================== */
.setores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

@media (max-width: 992px) {
  .setores-grid {
    grid-template-columns: 1fr;
  }
}

.setor-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}

.setor-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.setor-card-header {
  padding: clamp(1.2rem, 3vw, 1.75rem) clamp(1rem, 2.5vw, 1.5rem) 1rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.setor-card.educacao .setor-card-header {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.1) 0%, transparent 100%);
  border-top: 4px solid var(--setor-educacao);
}

.setor-card.comunicacao .setor-card-header {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.1) 0%, transparent 100%);
  border-top: 4px solid var(--setor-comunicacao);
}

.setor-card.ti .setor-card-header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
  border-top: 4px solid var(--setor-ti);
}

.setor-step-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.3rem;
  display: inline-block;
}

.setor-card.educacao .setor-step-tag { color: var(--setor-educacao); }
.setor-card.comunicacao .setor-step-tag { color: var(--setor-comunicacao); }
.setor-card.ti .setor-step-tag { color: var(--setor-ti); }

.setor-name {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.setor-foco {
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  font-weight: 600;
  color: var(--text-muted);
}

.setor-card-body {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.setor-block-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  margin-bottom: 0.35rem;
}

.setor-atribuicoes-text {
  font-size: clamp(0.85rem, 1.8vw, 0.92rem);
  color: var(--text-secondary);
  line-height: 1.5;
}

.setor-delivery-box {
  background-color: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  border-left: 4px solid;
}

.setor-card.educacao .setor-delivery-box { border-left-color: var(--setor-educacao); }
.setor-card.comunicacao .setor-delivery-box { border-left-color: var(--setor-comunicacao); }
.setor-card.ti .setor-delivery-box { border-left-color: var(--setor-ti); }

.delivery-box-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.setor-card.educacao .delivery-box-title { color: var(--setor-educacao); }
.setor-card.comunicacao .delivery-box-title { color: var(--setor-comunicacao); }
.setor-card.ti .delivery-box-title { color: var(--setor-ti); }

.delivery-box-text {
  font-size: clamp(0.85rem, 1.8vw, 0.92rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
}

/* ==========================================================================
   ABA 4: GUIA RÁPIDO & SIMULADOR COM QUICK CHIPS (RESPONSIVO)
   ========================================================================== */
.guia-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 1.5rem);
  margin-bottom: 2rem;
}

@media (max-width: 992px) {
  .guia-grid-3 {
    grid-template-columns: 1fr;
  }
}

.guia-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2.5vw, 1.5rem);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.guia-card-header {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  font-weight: 800;
  color: var(--text-primary);
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.guia-situacoes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.guia-situacoes-list li {
  font-size: clamp(0.82rem, 1.8vw, 0.88rem);
  color: var(--text-secondary);
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card-subtle);
  transition: all var(--transition-fast);
}

.guia-situacoes-list li:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  transform: translateX(3px);
}

.guia-situacoes-list li::before {
  content: "•";
  color: var(--senai-cyan);
  font-size: 1.3rem;
  line-height: 1;
}

/* Ferramenta de Diagnóstico Ágil com Atalhos de Toque (Chips) */
.diagnostic-tool-box {
  background: linear-gradient(135deg, rgba(0, 69, 135, 0.05) 0%, rgba(0, 163, 224, 0.05) 100%);
  border: 1px dashed var(--senai-cyan);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2.5vw, 1.5rem);
  margin-top: 1.5rem;
}

.diagnostic-tool-title {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  font-weight: 800;
  color: var(--senai-blue-primary);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quick-scenario-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.quick-chip {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.quick-chip:hover, .quick-chip.active {
  background-color: var(--senai-blue-primary);
  color: #ffffff;
  border-color: var(--senai-blue-primary);
}

.diagnostic-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  margin-bottom: 0.85rem;
  min-height: var(--touch-target-min);
}

.diagnostic-result-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: clamp(0.85rem, 2vw, 1.25rem);
  box-shadow: var(--shadow-sm);
}

/* Tabela de Demandas e Prioridades com Scroll Responsivo */
.demandas-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: clamp(1rem, 2.5vw, 1.75rem);
  box-shadow: var(--shadow-sm);
}

.demandas-header {
  margin-bottom: 1.25rem;
}

.demandas-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.demandas-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  text-align: left;
}

.demandas-table th {
  background-color: var(--bg-card-subtle);
  padding: 0.8rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.demandas-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 0.88rem;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.priority-badge.prioridade-urgente { background-color: var(--prio-urgente); color: #ffffff; }
.priority-badge.prioridade-alta { background-color: var(--prio-alta); color: #ffffff; }
.priority-badge.prioridade-media { background-color: var(--prio-media); color: #ffffff; }
.priority-badge.prioridade-planejada { background-color: var(--prio-planejada); color: #ffffff; }

.sla-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-top: 0.25rem;
  white-space: nowrap;
}

/* ==========================================================================
   ABA 5: CHECKLIST DE PUBLICAÇÃO & GESTÃO (TOUCH FRIENDLY)
   ========================================================================== */
.checklist-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: clamp(1rem, 2.5vw, 1.75rem);
  box-shadow: var(--shadow-sm);
}

.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.progress-bar-container {
  width: 100%;
  height: 12px;
  background-color: var(--bg-card-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--senai-blue-primary), var(--senai-cyan));
  width: 0%;
  transition: width 0.4s ease;
}

.checklist-groups {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.check-group {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: clamp(0.85rem, 2vw, 1.25rem);
  background-color: var(--bg-card-subtle);
}

.check-group-title {
  font-family: var(--font-heading);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.check-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  min-height: var(--touch-target-min);
}

.check-item:hover {
  border-color: var(--senai-cyan);
  transform: translateX(2px);
}

.check-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--senai-blue-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.check-item span {
  font-size: clamp(0.82rem, 1.8vw, 0.9rem);
  line-height: 1.4;
}

.check-item.completed {
  background-color: rgba(34, 197, 94, 0.08);
  border-color: #22c55e;
}

.check-item.completed span {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* ==========================================================================
   ABA 6: TERMO DE CIÊNCIA E VALIDAÇÃO INSTITUCIONAL (RESPONSIVO)
   ========================================================================== */
.signatarios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

@media (max-width: 992px) {
  .signatarios-grid {
    grid-template-columns: 1fr;
  }
}

.signatario-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.signatario-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--senai-blue-primary), var(--senai-cyan));
}

.seal-icon {
  width: 52px;
  height: 52px;
  margin: 0.25rem auto 0.75rem;
  border-radius: 50%;
  background: var(--bg-card-subtle);
  border: 2px dashed var(--senai-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--senai-blue-primary);
  flex-shrink: 0;
}

.signatario-setor {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 2vw, 1.15rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.signatario-cargo {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--senai-blue-light);
  margin-bottom: 0.85rem;
}

.signatario-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 1.25rem;
  flex: 1;
}

.signatario-footer {
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.status-badge-validated {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background-color: rgba(34, 197, 94, 0.15);
  color: #15803d;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.75rem;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .status-badge-validated {
  color: #4ade80;
}

/* ==========================================================================
   MODAL DE DETALHES DA TAREFA & BOTTOM SHEET NO MOBILE
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

/* Puxador para modo Bottom Sheet */
.modal-drag-handle {
  display: none;
  width: 40px;
  height: 5px;
  background-color: var(--border-color);
  border-radius: var(--radius-full);
  margin: 0.65rem auto 0.25rem;
}

@media (max-width: 640px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 85vh;
    transform: translateY(100%);
  }

  .modal-overlay.open .modal-card {
    transform: translateY(0);
  }

  .modal-drag-handle {
    display: block;
  }
}

.modal-header {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
}

.modal-close-btn:hover {
  background-color: var(--bg-card-subtle);
  color: var(--text-primary);
}

.modal-body {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ==========================================================================
   RODAPÉ INSTITUCIONAL (RESPONSIVO)
   ========================================================================== */
.main-footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: clamp(1.25rem, 3vw, 2rem) 0;
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  color: var(--text-muted);
  margin-top: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}

.footer-branding {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==========================================================================
   BOTÃO FLUTUANTE DE VOLTAR AO TOPO COM INDICADOR CIRCULAR DE PROGRESSO
   ========================================================================== */
#btn-back-to-top.btn-back-to-top {
  position: fixed !important;
  bottom: clamp(1.25rem, 3vw, 2.25rem) !important;
  right: clamp(1.25rem, 3vw, 2.25rem) !important;
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  max-width: 52px !important;
  max-height: 52px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, var(--senai-blue-primary, #004587) 0%, #002d5a 100%) !important;
  border: 2px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 6px 20px rgba(0, 45, 90, 0.45), 0 0 15px rgba(0, 163, 224, 0.3) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(20px) scale(0.85) !important;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.3s,
              box-shadow var(--transition-fast),
              border-color var(--transition-fast) !important;
  pointer-events: none !important;
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
  box-sizing: border-box !important;
}

#btn-back-to-top.btn-back-to-top.visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto !important;
}

#btn-back-to-top.btn-back-to-top:hover {
  transform: translateY(-4px) scale(1.08) !important;
  border-color: var(--senai-cyan, #00a3e0) !important;
  box-shadow: 0 10px 28px rgba(0, 69, 135, 0.5), 0 0 20px rgba(0, 163, 224, 0.5) !important;
}

#btn-back-to-top.btn-back-to-top:active {
  transform: translateY(-1px) scale(0.95) !important;
}

.back-to-top-svg {
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  display: block !important;
  transform: rotate(-90deg) !important;
}

.back-to-top-svg polyline {
  transform: rotate(90deg) !important;
  transform-origin: 24px 24px !important;
  transition: transform var(--transition-fast) !important;
}

#btn-back-to-top.btn-back-to-top:hover .back-to-top-svg polyline {
  transform: rotate(90deg) translateY(-2px) !important;
}

.progress-indicator {
  transition: stroke-dashoffset 0.15s ease-out !important;
}

/* Tooltip flutuante ao lado do botão */
.back-to-top-tooltip {
  position: absolute !important;
  right: calc(100% + 12px) !important;
  top: 50% !important;
  transform: translateY(-50%) translateX(6px) !important;
  background-color: var(--senai-blue-deep, #001e3d) !important;
  color: #ffffff !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: var(--radius-md, 8px) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(0, 163, 224, 0.3) !important;
  pointer-events: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: all var(--transition-fast) !important;
}

#btn-back-to-top.btn-back-to-top:hover .back-to-top-tooltip {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(-50%) translateX(0) !important;
}

/* Modo Escuro */
[data-theme="dark"] #btn-back-to-top.btn-back-to-top {
  background: linear-gradient(135deg, #0b172a 0%, #004587 100%) !important;
  border-color: rgba(0, 163, 224, 0.5) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 16px rgba(0, 163, 224, 0.4) !important;
}

/* Mobile */
@media (max-width: 768px) {
  #btn-back-to-top.btn-back-to-top {
    bottom: max(1rem, env(safe-area-inset-bottom, 1rem)) !important;
    right: 1rem !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    max-width: 46px !important;
    max-height: 46px !important;
  }

  .back-to-top-svg {
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
  }

  .back-to-top-tooltip {
    display: none !important;
  }
}

/* ==========================================================================
   SUPORTE A IMPRESSÃO & EXPORTAÇÃO EM PDF OFICIAL (@media print)
   ========================================================================== */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }

  .topbar,
  .tabs-wrapper,
  .toolbar-controls,
  .diagnostic-tool-box,
  .btn-icon-top,
  .btn-back-to-top,
  .modal-overlay,
  .view-toggle-group,
  .mobile-swipe-hint {
    display: none !important;
  }

  .tab-pane {
    display: block !important;
    margin-bottom: 2rem;
    page-break-after: always;
  }

  .hero-header {
    background: none !important;
    border-bottom: 2px solid #000000 !important;
    padding: 1rem 0 !important;
  }

  .hero-title {
    color: #000000 !important;
    font-size: 18pt !important;
  }

  .table-responsive {
    box-shadow: none !important;
    border: 1px solid #000000 !important;
    overflow-x: visible !important;
  }

  .raci-table {
    min-width: 100% !important;
  }

  .raci-table thead th {
    background-color: #f1f5f9 !important;
    color: #000000 !important;
    border-bottom: 2px solid #000000 !important;
  }

  .raci-badge {
    border: 1px solid #000000 !important;
    color: #000000 !important;
    background: transparent !important;
  }
}
