/* BRAZSAFE utility layer - small, scoped helpers and responsive polish. */

.bs-hidden {
  display: none !important;
}

.bs-muted {
  color: var(--bs-muted) !important;
}

.bs-nowrap {
  white-space: nowrap !important;
}

.bs-scroll-x {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

.bs-stack {
  display: grid !important;
  gap: 12px !important;
}

.bs-inline {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

body .main-content ::selection {
  background: rgba(14, 165, 233, 0.22);
  color: var(--bs-ink);
}

body .main-content * {
  scrollbar-width: thin;
  scrollbar-color: rgba(30, 74, 108, 0.42) transparent;
}

body .main-content *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body .main-content *::-webkit-scrollbar-track {
  background: transparent;
}

body .main-content *::-webkit-scrollbar-thumb {
  background: rgba(30, 74, 108, 0.28);
  border: 3px solid transparent;
  border-radius: var(--bs-radius-pill);
  background-clip: padding-box;
}

body .main-content *::-webkit-scrollbar-thumb:hover {
  background: rgba(30, 74, 108, 0.48);
  border: 3px solid transparent;
  background-clip: padding-box;
}

body .main-content .empty,
body .main-content .skeleton,
body .main-content .train-search-empty {
  border-radius: var(--bs-radius-md);
}

body .main-content .empty,
body .main-content .train-search-empty {
  border: 1px dashed var(--bs-line-strong);
  background: var(--bs-surface-soft);
  color: var(--bs-muted);
  padding: 16px;
}

body .main-content .skeleton {
  background: linear-gradient(90deg, #f3f7fb, #e9f1f8, #f3f7fb);
  background-size: 220% 100%;
  animation: bsSkeleton 1.15s linear infinite;
}

@keyframes bsSkeleton {
  0% { background-position: 220% 0; }
  100% { background-position: -220% 0; }
}

@media (prefers-reduced-motion: reduce) {
  body .page.active,
  body .main-content .skeleton,
  body .main-content .btn,
  body .main-content button,
  body .main-content .panel,
  body .main-content .store-card,
  body .main-content .train-card {
    animation: none !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 980px) {
  body .main-content {
    padding: 18px 16px 32px;
  }

  body .main-content .table-wrap,
  body #estoqueConteudo .table-wrap,
  body #treinamentosConcluidosWrap .table-wrap,
  body #vencimentos .table-wrap {
    overflow-x: auto;
  }
}

@media (max-width: 768px) {
  body .main-content {
    padding: 12px 12px 28px !important;
  }

  body .main-content .btn,
  body .main-content button.btn,
  body .main-content .btn-primary,
  body .main-content .btn-secondary,
  body .main-content .btn--primary,
  body .main-content .btn--secondary {
    min-height: 42px;
  }

  body .main-content .table-wrap,
  body #estoqueConteudo .table-wrap,
  body #treinamentosConcluidosWrap .table-wrap,
  body #vencimentos .table-wrap,
  body #gestaoGerentes .table-wrap {
    border-radius: var(--bs-radius-md) !important;
    padding: 6px !important;
  }

  body #histEstModal,
  body #ctrlModal,
  body #autEstModal,
  body #cadGerenteModal,
  body #preModal,
  body .modal,
  body .sala-treina-modal {
    left: 12px !important;
    right: 12px !important;
    top: 12px !important;
    bottom: auto !important;
    transform: none !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    margin: 0 !important;
    overflow-y: auto !important;
  }

  body #histEstModal [style*="display:flex"],
  body #ctrlModal [style*="display:flex"],
  body #preModal [style*="display:flex"] {
    flex-wrap: wrap;
  }

  body #histSearch {
    min-width: 0 !important;
    width: 100% !important;
  }

  body #novoEPI #listaEPIs .table-epi tbody td:nth-child(6),
  body #novoEPI #listaEPIs .cell-desc {
    max-width: 320px;
  }
}
