/* ============================================================
   EQI Budget System — module-tabs.css
   B3 — Tabs internas para módulos com sub-rotas.
   Depende de: ../styles.css (design tokens)
   ============================================================ */

/* ============================================================
   TAB BAR CONTAINER
   Fixada no topo do main, abaixo do breadcrumb/header do módulo.
   ============================================================ */
.mt-tab-bar {
  display: -webkit-box;
  display:    -ms-flexbox;
  display:        flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border, #D0DCDA);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border, #D0DCDA) transparent;
}

.mt-tab-bar::-webkit-scrollbar {
  height: 6px;
}

.mt-tab-bar::-webkit-scrollbar-track {
  background: transparent;
}

.mt-tab-bar::-webkit-scrollbar-thumb {
  background-color: var(--border, #D0DCDA);
  border-radius: 3px;
}

.mt-tab-bar::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-muted, #5A6A66);
}

/* ============================================================
   TAB ITEM (link)
   ============================================================ */
.mt-tab {
  display: -webkit-inline-box;
  display:    -ms-inline-flexbox;
  display:        inline-flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted, #5A6A66);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  position: relative;
  top: 1px; /* align border with container border */
  -ms-flex-negative: 0;
      flex-shrink: 0;
}

.mt-tab:hover {
  color: var(--text-base, #1A1A1A);
}

.mt-tab:focus-visible {
  outline: 2px solid var(--green-light, #63C6A5);
  outline-offset: -2px;
  border-radius: 4px 4px 0 0;
}

/* ============================================================
   TAB ATIVA
   ============================================================ */
.mt-tab.is-active {
  color: var(--green-primary, #009E76);
  font-weight: 600;
  border-bottom-color: var(--green-primary, #009E76);
}

/* ============================================================
   INDICADOR DE CONTAGEM (opcional, para pendências)
   ============================================================ */
.mt-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background-color: var(--surface, #F2EDED);
  color: var(--text-muted, #5A6A66);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
}

.mt-tab.is-active .mt-tab-count {
  background-color: rgba(0, 158, 118, 0.1);
  color: var(--green-primary, #009E76);
}

/* ============================================================
   RESPONSIVE — MOBILE
   Scroll horizontal com fade indicator
   ============================================================ */
@media (max-width: 767px) {
  .mt-tab-bar {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .mt-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
}

/* ============================================================
   ACCESSIBILITY: prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .mt-tab {
    transition: none;
  }
}

/* ============================================================
   PRINT: mostrar apenas a tab ativa como texto
   ============================================================ */
@media print {
  .mt-tab-bar {
    border-bottom: none;
    overflow: visible;
  }

  .mt-tab:not(.is-active) {
    display: none;
  }

  .mt-tab.is-active {
    border-bottom: none;
    font-weight: 700;
    padding: 0;
  }
}
