/* ============================================================
   KWN Engenharia — Descrição de Cargos
   Design refinado inspirado no padrão KWN TEMS
   ============================================================ */

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

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

:root {
  --red:         #ee1c25;
  --red-dark:    #c8151d;
  --red-light:   #fef2f2;
  --red-border:  #fecaca;
  --dark:        #414143;
  --dark-800:    #2e2e30;
  --gray-700:    #374151;
  --gray-600:    #4b5563;
  --gray-500:    #6b7280;
  --gray-400:    #9ca3af;
  --gray-300:    #d1d5db;
  --gray-200:    #e5e7eb;
  --gray-100:    #f3f4f6;
  --gray-50:     #f9fafb;
  --white:       #ffffff;

  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --radius-sm:  4px;
  --radius:     8px;
  --radius-lg:  12px;

  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px 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.05);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);

  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--gray-700);
  background-color: var(--gray-50);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   CABEÇALHO
   ============================================================ */

.site-header {
  background-color: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.header-divider {
  width: 1px;
  height: 36px;
  background-color: var(--gray-200);
  flex-shrink: 0;
}

.logo-img {
  display: block;
  height: 40px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.header-titles {
  min-width: 0;
}

.page-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  letter-spacing: -0.01em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-subtitle {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--red-light);
  border: 1px solid var(--red-border);
  color: var(--red);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 20px;
}

.header-badge-dot {
  width: 6px;
  height: 6px;
  background-color: var(--red);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   HERO / INTRO
   ============================================================ */

.intro-section {
  background: linear-gradient(135deg, var(--dark-800) 0%, var(--dark) 100%);
  padding: 44px 0 40px;
  border-bottom: 3px solid var(--red);
}

.intro-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.intro-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}

.intro-eyebrow::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--red);
  border-radius: 1px;
}

.intro-heading {
  font-size: 26px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 14px;
}

.intro-text {
  font-size: 14px;
  color: rgba(255,255,255,0.60);
  line-height: 1.75;
  max-width: 640px;
}

.intro-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 20px;
  flex-wrap: wrap;
}

.stat-item {
  flex: 1;
  min-width: 100px;
  padding-right: 24px;
}

.stat-item + .stat-item {
  padding-left: 24px;
  border-left: 1px solid rgba(255,255,255,0.10);
}

.stat-number {
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ============================================================
   BARRA DE BUSCA + ÍNDICE
   ============================================================ */

.toolbar {
  background-color: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 0;
  position: sticky;
  top: 68px;
  z-index: 90;
  box-shadow: var(--shadow-xs);
}

.toolbar-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Campo de busca */
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--gray-400);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: 9px 36px 9px 36px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--gray-700);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input::placeholder { color: var(--gray-400); }

.search-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(238,28,37,0.10);
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-100);
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  font-size: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background-color var(--transition), color var(--transition);
}

.search-clear:hover {
  background-color: var(--gray-200);
  color: var(--red);
}

/* Filtros por setor */
.sector-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.filter-btn.active {
  background-color: var(--red);
  border-color: var(--red);
  color: var(--white);
}

/* Hint de resultados */
.search-hint {
  width: 100%;
  font-size: 12px;
  color: var(--gray-500);
  padding-top: 4px;
  min-height: 16px;
  display: none;
}

.search-hint.visible { display: block; }

/* ============================================================
   CONTEÚDO PRINCIPAL
   ============================================================ */

.main-content {
  padding: 32px 0 64px;
}

/* ============================================================
   SEÇÃO DE SETOR
   ============================================================ */

.sector-section {
  margin-bottom: 36px;
}

.sector-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sector-accent {
  width: 3px;
  height: 20px;
  background-color: var(--red);
  border-radius: 2px;
  flex-shrink: 0;
}

.sector-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sector-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  letter-spacing: 0.04em;
}

.sector-divider {
  flex: 1;
  height: 1px;
  background-color: var(--gray-200);
}

.sector-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ============================================================
   CARD DE CARGO
   ============================================================ */

.cargo-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.cargo-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--gray-300);
}

.cargo-card.is-open {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.cargo-card.is-hidden {
  display: none;
}

/* Botão de toggle */
.cargo-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  transition: background-color var(--transition);
}

.cargo-toggle:hover {
  background-color: var(--gray-50);
}

.cargo-toggle-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cargo-index {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background-color: var(--gray-100);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 0;
  transition: background-color var(--transition), color var(--transition);
}

.cargo-card.is-open .cargo-index {
  background-color: var(--red);
  color: var(--white);
}

.cargo-info {
  min-width: 0;
}

.cargo-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cargo-meta {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chevron */
.cargo-chevron {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  transition: transform var(--transition), color var(--transition), background-color var(--transition);
}

.cargo-chevron svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.cargo-card.is-open .cargo-chevron {
  transform: rotate(180deg);
  color: var(--red);
  background-color: var(--red-light);
}

/* Corpo do card */
.cargo-body {
  display: none;
  border-top: 1px solid var(--gray-100);
}

.cargo-body.is-open {
  display: block;
}

/* Campos */
.cargo-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.field-group {
  padding: 16px 20px;
  border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}

.field-group:nth-child(even) {
  border-right: none;
}

.field-group:nth-last-child(-n+2) {
  border-bottom: none;
}

/* Campo de treinamento — largura total */
.field-group--full {
  grid-column: 1 / -1;
  border-right: none;
  background-color: var(--red-light);
  border-left: 3px solid var(--red);
  border-bottom: none;
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-400);
  line-height: 1;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-label-icon {
  width: 12px;
  height: 12px;
  color: var(--gray-400);
  flex-shrink: 0;
}

.field-group--full .field-label {
  color: var(--red-dark);
}

.field-group--full .field-label-icon {
  color: var(--red);
}

.field-value {
  font-size: 13.5px;
  color: var(--gray-700);
  line-height: 1.65;
}

.field-group--full .field-value {
  color: var(--dark);
}

/* ============================================================
   ETIQUETA DE ESTRUTURA (BASE / CONDICIONAL)
   ============================================================ */

.cargo-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 5px;
  line-height: 1.4;
}

.cargo-tag--condicional {
  background-color: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
}

.cargo-tag--condicional::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #0ea5e9;
  flex-shrink: 0;
}

/* ============================================================
   SEM RESULTADOS
   ============================================================ */

.no-results {
  display: none;
  text-align: center;
  padding: 72px 24px;
}

.no-results-icon {
  width: 48px;
  height: 48px;
  color: var(--gray-300);
  margin: 0 auto 16px;
}

.no-results-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}

.no-results-sub {
  font-size: 13.5px;
  color: var(--gray-500);
  line-height: 1.6;
}

/* ============================================================
   RODAPÉ
   ============================================================ */

.site-footer {
  background-color: var(--dark-800);
  padding: 32px 0;
  border-top: 3px solid var(--red);
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-logo {
  height: 32px;
  width: auto;
  opacity: 0.55;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.footer-content {
  flex: 1;
  min-width: 200px;
}

.footer-text {
  font-size: 12.5px;
  color: rgba(255,255,255,0.45);
  line-height: 1.75;
  font-style: italic;
}

.footer-copy {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  margin-top: 10px;
  letter-spacing: 0.04em;
}

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */

@media (max-width: 720px) {
  .header-inner {
    height: 60px;
  }

  .header-badge {
    display: none;
  }

  .intro-heading {
    font-size: 20px;
  }

  .intro-stats {
    gap: 16px;
  }

  .stat-item {
    min-width: 80px;
    padding-right: 16px;
  }

  .stat-item + .stat-item {
    padding-left: 16px;
  }

  .toolbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .search-wrap {
    width: 100%;
  }

  .cargo-fields {
    grid-template-columns: 1fr;
  }

  .field-group {
    border-right: none;
    border-bottom: 1px solid var(--gray-100);
  }

  .field-group:last-child {
    border-bottom: none;
  }

  .field-group--full {
    border-bottom: none;
  }

  .cargo-name {
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .container,
  .header-inner,
  .intro-inner,
  .toolbar-inner,
  .footer-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .intro-section {
    padding: 32px 0 28px;
  }

  .header-divider,
  .header-titles {
    display: none;
  }

  .toolbar {
    top: 60px;
  }

  .sector-filters {
    display: none;
  }
}

/* ============================================================
   IMPRESSÃO
   ============================================================ */

@media print {
  .site-header,
  .toolbar {
    position: static !important;
  }

  .cargo-body {
    display: block !important;
  }

  .cargo-chevron,
  .toolbar,
  .sector-filters {
    display: none !important;
  }
}
