/**
 * EMOSA ERP/MES — chrome de tablas (obligatorio)
 * Ver: mes/docs/UI-STANDARDS.md
 *
 * Tooltips: flotantes en document.body (no ::after) para no quedar
 * detrás de .table-wrap { overflow:auto } / thead sticky.
 */
:root {
  --emosa-table-offset: 200px;
  --emosa-th-bg: #1c3224;
  --emosa-tip-bg: #0f1c14;
  --emosa-tip-border: rgba(111, 191, 74, 0.45);
  --emosa-tip-text: #e7f0e4;
}

.emosa-topbar,
.topbar.emosa-sticky,
header.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
}

.emosa-table-wrap,
.table-wrap.emosa-scroll {
  max-height: calc(100vh - var(--emosa-table-offset));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.emosa-table-wrap > table,
.table-wrap.emosa-scroll > table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.emosa-table-wrap thead th,
.table-wrap.emosa-scroll thead th,
table.emosa-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
  vertical-align: middle;
}

th.emosa-th,
.emosa-table-wrap thead th,
.table-wrap.emosa-scroll thead th {
  cursor: default;
}

.th-label {
  display: inline;
  margin-right: 0.35em;
}

.th-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 1.15em;
  height: 1.15em;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.75;
  cursor: help;
  font-size: 0.85em;
  line-height: 1;
  vertical-align: -0.05em;
  z-index: 6;
}

.th-tip:hover,
.th-tip:focus {
  opacity: 1;
  outline: none;
}

/* Popover global — fuera del overflow de la tabla */
.emosa-tip-float {
  position: fixed;
  z-index: 10050;
  min-width: 160px;
  max-width: 300px;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--emosa-tip-bg);
  color: var(--emosa-tip-text);
  border: 1px solid var(--emosa-tip-border);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease;
}

.emosa-tip-float.is-on {
  opacity: 1;
  visibility: visible;
}
