/* =============================================================================
   ROAC Buscador & Vista Detalle — ICAC 2025
   ============================================================================= */

/* ── Variables locales ──────────────────────────────────────────────────────── */
:root { --roac-card-bg: #f8fafc; --roac-border: #e5e5e5; --roac-text: #0a0a0a; --roac-muted: #525252; --roac-primary: #b91c1c; --roac-badge-bg: #ffffff; }

/* ── Layout base ────────────────────────────────────────────────────────────── */
.roac-page-wrapper { max-width: 1280px; margin: 0 auto; padding: 64px 24px; width: 100%; }

/* ── Breadcrumb ─────────────────────────────────────────────────────────────── */
.roac-page-hero { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.roac-breadcrumb { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.roac-breadcrumb a { font-size: 14px; color: var(--roac-muted); text-decoration: none; }
.roac-breadcrumb a:hover { text-decoration: underline; }
.roac-breadcrumb__current { font-size: 14px; color: var(--roac-text); }
.roac-page-title { font-size: 36px; font-weight: 700; color: var(--roac-text); line-height: 40px; margin: 0; }

/* ── Container Layout ───────────────────────────────────────────────────────── */
.roac-container { background: #fff; max-width: 1280px; margin: 0 auto; padding: 40px 24px 40px; width: 100%; box-sizing: border-box; }
.roac-layout { display: flex; gap: 20px; align-items: flex-start; justify-content: center; width: 100%; }

/* ── Sidebar (Filters) ──────────────────────────────────────────────────────── */
.roac-sidebar { width: 305px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; align-items: flex-end; }
.roac-sidebar__header { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.roac-sidebar__title { font-size: 14px; font-weight: 600; color: #000; margin: 0; line-height: 20px; }
.roac-sidebar__form { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.roac-filter-group { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.roac-filter-group label { font-size: 14px; font-weight: 500; color: var(--roac-text); line-height: 1; }
.roac-input-wrapper { display: flex; align-items: center; background: #fff; border: 1px solid var(--roac-border); border-radius: 8px; height: 36px; padding: 4px 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.roac-input-wrapper input { flex: 1; width: 100%; border: none; background: transparent; font-size: 14px; color: var(--roac-muted); outline: none; }
.roac-input-wrapper input:focus { outline: none; }
.roac-select-wrapper { position: relative; padding: 8px 12px; }
.roac-select-wrapper select { appearance: none; -webkit-appearance: none; width: 100%; border: none; background: transparent; font-size: 14px; color: var(--roac-muted); cursor: pointer; outline: none; }
.roac-select-wrapper .roac-select-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.roac-btn-search { display: flex; align-items: center; justify-content: center; height: 36px; padding: 8px 16px; background: var(--roac-primary); color: #fafafa; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.05); transition: background 0.2s; width: 100%; }
.roac-btn-search:hover { background: #991b1b; }
.roac-btn-reset { display: flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 8px 16px; background: transparent; color: var(--roac-text); border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; width: 100%; transition: background 0.2s; }
.roac-btn-reset:hover { background: #f1f5f9; }

/* ── Main content (Results) ─────────────────────────────────────────────────── */
.roac-main { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; background: #fff; border-radius: 20px; }
.roac-results-info { font-size: 14px; color: var(--roac-muted); white-space: nowrap; }
.roac-results-info span { font-weight: 600; color: #0a0a0a; }

.roac-table-container { width: 100%; overflow-x: auto; }
.roac-table-main { width: 100%; border-collapse: collapse; font-family: 'Inter', sans-serif; text-align: left; }
.roac-table-main thead th { border-bottom: 1px solid var(--roac-border); padding: 0 8px; height: 40px; color: var(--roac-muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.roac-table-main tbody tr { border-bottom: 1px solid var(--roac-border); transition: background 0.15s; }
.roac-table-main tbody tr:last-child { border-bottom: none; }
.roac-table-main tbody tr:hover { background: #f8fafc; }
.roac-table-main tbody td { padding: 8px; height: 52px; font-size: 14px; font-weight: 500; color: var(--roac-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roac-table-main tbody td a { color: var(--roac-text); text-decoration: none; }
.roac-table-main tbody td a:hover { text-decoration: underline; color: var(--roac-primary); }

.roac-badge-active { background: #0f766e; border: 1px solid transparent; color: #fafafa; font-weight: 600; font-size: 12px; padding: 2px 8px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.roac-badge-inactive { background: #b91c1c; border: 1px solid transparent; color: #fef2f2; font-weight: 600; font-size: 12px; padding: 2px 8px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.roac-badge-neutral { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; font-weight: 600; font-size: 12px; padding: 2px 8px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

.roac-btn-action { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--roac-border); border-radius: 8px; background: transparent; color: #0a0a0a; box-shadow: 0 1px 2px rgba(0,0,0,0.05); transition: background 0.15s; }
.roac-btn-action:hover { background: #f8fafc; }
.roac-loading-spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid #e5e5e5; border-top-color: var(--roac-primary); border-radius: 50%; animation: roac-spin 0.6s linear infinite; margin-bottom: 8px; }
@keyframes roac-spin { to { transform: rotate(360deg); } }
.roac-no-results { text-align: center; padding: 48px 24px; color: var(--roac-muted); font-size: 16px; transition: opacity 0.3s ease-in-out; }

/* ── Skeleton Loaders & Transitions ─────────────────────────────────────────── */
.loading-skeleton {
  pointer-events: none;
}
.loading-skeleton tbody tr {
  animation: skeletonPulse 1s ease-in-out infinite;
}
.loading-skeleton tbody td {
  color: transparent !important;
}
.loading-skeleton tbody td a,
.loading-skeleton tbody td span,
.loading-skeleton tbody td .roac-badge-active,
.loading-skeleton tbody td .roac-badge-inactive,
.loading-skeleton tbody td .roac-badge-neutral {
  color: transparent !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.loading-skeleton tbody td::before {
  content: '';
  display: block;
  height: 14px;
  background-color: #e2e8f0;
  border-radius: 4px;
  width: 70%;
}
@keyframes skeletonPulse {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* ── Footer de la Tabla (Pagination) ────────────────────────────────────────── */
.roac-table-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; margin-top: 24px; width: 100%; border-top: 1px solid var(--roac-border); }
.roac-pagesize { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: #0a0a0a; }
.roac-pagesize select { background: transparent; border: 1px solid var(--roac-border); border-radius: 8px; padding: 4px 28px 4px 12px; height: 36px; font-size: 14px; appearance: none; cursor: pointer; outline: none; }
.roac-pagesize-wrapper { position: relative; display: flex; align-items: center; }
.roac-pagesize-wrapper svg { position: absolute; right: 10px; pointer-events: none; }

.roac-pagination { display: flex; align-items: center; gap: 4px; }
.roac-page-btn { display: flex; align-items: center; justify-content: center; gap: 4px; height: 36px; padding: 8px 16px; font-size: 14px; font-weight: 500; color: var(--roac-text); background: transparent; border: none; border-radius: 8px; cursor: pointer; transition: background 0.2s; }
.roac-page-btn:hover { background: #f1f5f9; }
.roac-page-btn.disabled { opacity: 0.5; cursor: not-allowed; }
.roac-page-num { display: flex; align-items: center; justify-content: center; height: 36px; width: 36px; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--roac-text); background: transparent; cursor: pointer; transition: background 0.2s; }
.roac-page-num:hover { background: #f1f5f9; }
.roac-page-num.is-active { background: #f1f5f9; color: var(--roac-primary); font-weight: 600; }
.roac-page-ellipsis { display: flex; align-items: center; justify-content: center; width: 36px; font-size: 14px; font-weight: 500; color: var(--roac-text); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .roac-layout { flex-direction: column; }
  .roac-sidebar { width: 100%; border-bottom: 1px solid var(--roac-border); padding-bottom: 24px; }
  .roac-sidebar__form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
  .roac-filter-group { width: auto; }
}
@media (max-width: 600px) {
  .roac-sidebar__form { grid-template-columns: 1fr; }
  .roac-container { padding: 32px 16px; }
}
