/* ============================================================================
   ACEF - tables.css : tablas, paginacion, resultados, detalle.
   Paleta corporativa CEF / Udima.
   ========================================================================== */

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table thead th {
  text-align: left; font-weight: 700; color: #ffffff; font-size: .73rem;
  text-transform: uppercase; letter-spacing: .04em; padding: .65rem .8rem;
  background: var(--primary); white-space: nowrap;
}
.table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.table thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.table tbody td { padding: .6rem .8rem; border-bottom: 1px solid var(--border); color: var(--text-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr { transition: background .1s; }
.table-hover tbody tr:hover { background: var(--accent-soft); }

.results-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.results-count { font-size: .85rem; color: var(--muted); font-weight: 550; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; font-size: .85rem; color: var(--text-soft); }

/* --- Detalle / modal ------------------------------------------------------ */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem 1.4rem; }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-field { display: flex; flex-direction: column; gap: .1rem; border-bottom: 1px dashed var(--border); padding-bottom: .45rem; }
.df-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.df-value { font-size: .9rem; color: var(--text); word-break: break-word; }
.detail-meta { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.meta-date { color: var(--muted); font-size: .82rem; }

.raw-payload { margin-top: 1.1rem; }
.raw-payload summary { cursor: pointer; font-weight: 600; color: var(--primary-dark); font-size: .85rem; }
.raw-payload pre {
  background: var(--sidebar-bg); color: #c8e6c9; padding: 1rem; border-radius: var(--radius-sm);
  overflow-x: auto; font-size: .78rem; margin-top: .6rem; font-family: var(--mono);
}

/* --- Modal overlay -------------------------------------------------------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(13, 33, 23, .5); display: flex; align-items: center; justify-content: center; padding: 1.2rem; z-index: 500; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 620px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 3px solid var(--accent); background: var(--primary-dark); }
.modal-head h2 { font-size: 1.05rem; color: #ffffff; }
.modal-close { background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: rgba(255,255,255,.6); }
.modal-close:hover { color: #fff; }
.modal-body { padding: 1.2rem; overflow-y: auto; }
.modal-foot { display: flex; gap: .5rem; padding: .9rem 1.2rem; border-top: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
