/* =========================================================
   TABLES (shared)
   UNIFICAR estilo de tablas en toda la app
========================================================= */

/* Scroll container */
.dc-pilots-table__scroll{
  width: 100%;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

/* Table base */
.dc-ptable{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px; /* mantiene cabeceras legibles */
}

.dc-ptable thead th{
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
  white-space: nowrap;
}

.dc-ptable tbody td{
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
}

.dc-ptable tbody tr:hover{
  background: var(--green-soft);
}

/* Estado con dots: columna centrada y compacta */
.dc-ptable th.dc-col-status,
.dc-ptable td.dc-col-status{
  width: 70px;
  text-align: center;
}
.dc-ptable td.dc-col-status .dc-usercard__dotwrap{
  margin: 0 auto;
}

/* Pager (unificado con lo que ya usas: dc-ppager) */
.dc-ppager{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 14px;
}

.dc-ppager__btn{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}
.dc-ppager__btn:hover{ background: var(--surface-2); }
.dc-ppager__btn:disabled{ opacity: .45; cursor: not-allowed; }

.dc-ppager__info{
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.dc-op-total{
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  gap: 6px;
}

.dc-op-total__label{
  font-weight: 800;
  color: var(--text);
}

.dc-op-total__value{
  font-weight: 800;
  font-size: 12px;
  color: var(--text);
}

/* =========================================================
   Ellipsis + tooltip (tablas)
========================================================= */
.dc-ellipsis{
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.dc-ttip{
  position: relative;
  cursor: help;
}
.dc-ttip::after{
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: rgba(28,31,35,.86);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  padding: 8px 10px;
  border-radius: 12px;
  white-space: normal;
  max-width: min(320px, 80vw);
  width: max-content;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  z-index: 9999;
}
.dc-ttip::before{
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(28,31,35,.86);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
  z-index: 9999;
}
.dc-ttip:hover::after,
.dc-ttip:hover::before{
  opacity: 1;
}

/* =========================================================
   Helpers compartidos de tablas
========================================================= */
.dc-ptable--fixed{
  table-layout: fixed;
}

.dc-sort{
  border: 0;
  background: transparent;
  padding: 0 0 0 6px;
  margin: 0;
  cursor: pointer;
  font: inherit;
  opacity: .7;
  color: inherit;
  text-decoration: none;
}
.dc-sort:visited,
.dc-sort:hover,
.dc-sort:focus,
.dc-sort:active{
  color: inherit;
  text-decoration: none;
}
.dc-sort:focus{
  outline: none;
}

.dc-cell-center{
  text-align: center;
  vertical-align: middle;
}

.dc-cell-ellipsis{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.dc-dot-center{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dc-dot-center .dc-usercard__dotwrap{
  justify-content: center;
}

/* =========================================================
   RANGO DOBLE (filtros)
========================================================= */

.dc-range{
  min-width: 220px;
}

.dc-range__row{
  display: grid;
  grid-template-columns: 60px minmax(140px, 1fr) 60px;
  gap: 8px;
  align-items: center;
}

.dc-range__num{
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(28,31,35,.12);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(28,31,35,.8);
}

.dc-range__track{
  position: relative;
  height: 28px;
}

.dc-range__track::before{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(28,31,35,.12);
}

.dc-range__input{
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  margin: 0;
}

.dc-range__input:first-child{
  z-index: 2;
}

.dc-range__input:last-child{
  z-index: 1;
}


.dc-range__input::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  cursor: pointer;
}

.dc-range__input::-moz-range-thumb{
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  cursor: pointer;
}

.dc-range__input::-moz-range-track{
  background: transparent;
}

/* =========================================================
   Frozen first column (sticky left) - Stripe pattern
========================================================= */
.dc-ptable--frozen th:first-child,
.dc-ptable--frozen td:first-child{
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
}
.dc-ptable--frozen thead th:first-child{
  z-index: 4;
}
.dc-ptable--frozen th:first-child::after,
.dc-ptable--frozen td:first-child::after{
  content: '';
  position: absolute;
  right: -6px;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(to right, rgba(0,0,0,.06), transparent);
  pointer-events: none;
}

/* =========================================================
   Hover expand para celdas truncadas
========================================================= */
.dc-ptable td.dc-trunc{
  position: relative;
  cursor: default;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dc-ptable td.dc-trunc > .dc-tc{
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dc-ptable td.dc-trunc:hover{
  overflow: visible;
  z-index: 10;
}
.dc-ptable td.dc-trunc:hover > .dc-tc{
  position: absolute;
  left: 0;
  top: 0;
  min-width: 100%;
  max-width: 320px;
  width: max-content;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  white-space: normal;
  word-break: break-word;
  overflow: visible;
  text-overflow: unset;
  z-index: 20;
  border: 1px solid var(--border);
}

/* =========================================================
   Scroll shadow indicators (visual cue)
========================================================= */
.dc-pilots-table__scroll--shadows{
  background:
    linear-gradient(to right, var(--surface), var(--surface)) 0 0 / 100% 100% no-repeat,
    linear-gradient(to right, rgba(0,0,0,.06), transparent) 0 0 / 16px 100% no-repeat,
    linear-gradient(to left,  rgba(0,0,0,.06), transparent) right 0 / 16px 100% no-repeat;
  background-attachment: local, scroll, scroll;
}
