[x-cloak] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, .7) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .55); border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

html { text-rendering: optimizeLegibility; }
body { letter-spacing: -0.01em; }

.glass { backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.field {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(203, 213, 225, .85);
  background: rgba(248, 250, 252, .8);
  padding: .7rem .85rem;
  color: #0f172a;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field:focus {
  border-color: rgba(255, 209, 58, .72);
  box-shadow: 0 0 0 4px rgba(255, 209, 58, .18);
  background: #fff;
}

.dark .field {
  border-color: rgba(255, 255, 255, .1);
  background: rgba(15, 23, 42, .72);
  color: #fff;
}
.dark .field:focus { background: rgba(15, 23, 42, .95); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ffd13a;
  color: #020617;
  font-weight: 600;
  padding: .65rem 1rem;
  transition: transform .16s ease, opacity .16s ease, background .16s ease;
}
.btn-primary:hover { transform: translateY(-1px); background: #f5c400; }
.btn-primary:disabled { opacity: .55; transform: none; }
.dark .btn-primary { background: #ffd13a; color: #020617; }
.dark .btn-primary:hover { background: #f5c400; }


.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, .8);
  color: #475569;
  padding: .6rem .9rem;
  transition: background .16s ease, color .16s ease;
}
.btn-secondary:hover { background: #f8fafc; color: #0f172a; }
.dark .btn-secondary { border-color: rgba(255, 255, 255, .1); color: #cbd5e1; }
.dark .btn-secondary:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.chip {
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, .78);
  padding: .42rem .7rem;
  color: #475569;
  background: rgba(255, 255, 255, .62);
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.chip:hover { background: #fff; color: #020617; }
.dark .chip { border-color: rgba(255,255,255,.1); color: #cbd5e1; background: rgba(15,23,42,.56); }
.dark .chip:hover { background: rgba(255,255,255,.08); color: #fff; }

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  border-radius: 14px;
  padding: .62rem .75rem;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item:hover { transform: translateX(1px); }
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 auto;
}
.nav-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}
.nav-active { background: #ffd13a; color: #020617; }
.dark .nav-active { background: #ffd13a; color: #020617; }
.nav-idle { color: #475569; }
.nav-idle:hover { background: rgba(255, 209, 58, .12); color: #0f172a; }
.dark .nav-idle { color: #cbd5e1; }
.dark .nav-idle:hover { background: rgba(255, 209, 58, .10); color: #fff; }

.panel,
.metric-card,
.info-card,
.table-card {
  border: 1px solid rgba(226, 232, 240, .95);
  background: rgba(255, 255, 255, .86);
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.dark .panel,
.dark .metric-card,
.dark .info-card,
.dark .table-card {
  border-color: rgba(255, 255, 255, .09);
  background: rgba(15, 23, 42, .66);
}

.metric-card { padding: 1.15rem; }
.metric-label { font-size: .75rem; color: #64748b; }
.dark .metric-label { color: #94a3b8; }
.metric-value { margin-top: .5rem; font-size: 2rem; line-height: 1; font-weight: 700; letter-spacing: -.04em; color: #020617; }
.dark .metric-value { color: #ffd13a; }

.info-card { padding: 1.2rem; }
.info-card h4 { margin-top: .75rem; font-weight: 650; color: #0f172a; }
.info-card p { margin-top: .4rem; color: #64748b; font-size: .875rem; line-height: 1.55; }
.dark .info-card h4 { color: #fff; }
.dark .info-card p { color: #94a3b8; }
.info-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #ffd13a;
  color: #020617;
}
.dark .info-icon { background: #ffd13a; color: #020617; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.section-head h3 { font-weight: 650; font-size: 1.15rem; letter-spacing: -.03em; }
.section-kicker {
  text-transform: uppercase;
  font-size: .68rem;
  letter-spacing: .08em;
  color: #64748b;
  margin-bottom: .15rem;
}
.dark .section-kicker { color: #94a3b8; }

.table-card { overflow: hidden; }
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .875rem;
}
.data-table thead { background: rgba(248, 250, 252, .88); }
.dark .data-table thead { background: rgba(255, 255, 255, .04); }
.data-table th {
  padding: .8rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 650;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.dark .data-table th { color: #94a3b8; }
.data-table td {
  padding: .9rem 1rem;
  border-top: 1px solid rgba(226, 232, 240, .82);
}
.dark .data-table td { border-top-color: rgba(255,255,255,.08); }
.muted { color: #64748b; }
.dark .muted { color: #94a3b8; }
.badge {
  display: inline-flex;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  padding: .28rem .55rem;
  font-size: .72rem;
  font-weight: 600;
}
.dark .badge { background: rgba(255,255,255,.08); color: #cbd5e1; }
.empty-cell {
  padding: 2.25rem 1rem !important;
  text-align: center;
  color: #64748b;
}
.dark .empty-cell { color: #94a3b8; }

.link-action { color: #117951; font-size: .78rem; font-weight: 600; }
.link-action:hover { text-decoration: underline; }
.link-danger { color: #dc2626; font-size: .78rem; font-weight: 600; }
.link-danger:hover { text-decoration: underline; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 6, 23, .58);
}
.modal-card {
  width: 100%;
  border-radius: 24px;
  border: 1px solid rgba(226, 232, 240, .95);
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 24px 90px rgba(2, 6, 23, .22);
}
.dark .modal-card {
  border-color: rgba(255,255,255,.1);
  background: #0f172a;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fadeIn { animation: fadeIn .22s ease-out; }

/* ── Brand color = #ffd13a (amarillo) ── */
/* Tailwind CDN no soporta colores custom via config; usamos clases CSS manuales */
.bg-brand-50  { background-color: #fffae8; }
.bg-brand-100 { background-color: #fff3c2; }
.bg-brand-200 { background-color: #ffe880; }
.bg-brand-300 { background-color: #ffd13a; }
.bg-brand-400 { background-color: #ffc600; }
.bg-brand-500 { background-color: #f5b800; }
.bg-brand-600 { background-color: #ffd13a !important; color: #020617 !important; }
.bg-brand-700 { background-color: #f5c400 !important; }
.bg-brand-800 { background-color: #d4a900; }
.bg-brand-900 { background-color: rgba(255, 209, 58, 0.15); }
.bg-brand-900\/50 { background-color: rgba(255, 209, 58, 0.12); }

.text-brand-300 { color: #ffd13a; }
.text-brand-400 { color: #ffc600; }
.text-brand-500 { color: #f5b800; }
.text-brand-600 { color: #a07200 !important; }
.text-brand-700 { color: #a07200; }
.dark .text-brand-300 { color: #ffd13a; }
.dark .text-brand-400 { color: #ffd13a; }
.dark .text-brand-600 { color: #ffd13a !important; }
.dark .text-brand-700 { color: #ffd13a; }

.border-brand-500 { border-color: #ffd13a !important; }
.border-brand-600 { border-color: #f5c400; }

/* Hover variants */
.hover\:bg-brand-700:hover { background-color: #f5c400 !important; color: #020617 !important; }

/* Dark variants */
.dark .bg-brand-900\/50 { background-color: rgba(255, 209, 58, 0.10); }

/* Link action override para brand */
.link-action { color: #a07200; font-size: .78rem; font-weight: 600; }
.link-action:hover { text-decoration: underline; color: #020617; }
.dark .link-action { color: #ffd13a; }
.dark .link-action:hover { color: #fff; }

/* ── Tablas y panels con tema negro/blanco/amarillo ── */
.entity-table-wrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
}
.dark .entity-table-wrap {
  background: #0f172a;
  border-color: rgba(255,255,255,.09);
}
.entity-table-wrap thead {
  background: #f8fafc;
}
.dark .entity-table-wrap thead {
  background: rgba(255,255,255,.04);
}
.entity-table-wrap thead th {
  padding: .7rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  user-select: none;
}
.dark .entity-table-wrap thead th { color: #94a3b8; }
.entity-table-wrap tbody tr {
  border-top: 1px solid #f1f5f9;
  transition: background .12s;
}
.entity-table-wrap tbody tr:hover { background: rgba(255,209,58,.06); }
.dark .entity-table-wrap tbody tr { border-top-color: rgba(255,255,255,.05); }
.dark .entity-table-wrap tbody tr:hover { background: rgba(255,209,58,.05); }
.entity-table-wrap td { padding: .8rem 1rem; font-size: .875rem; }

/* Toolbar de búsqueda / filtros */
.search-input {
  width: 100%;
  padding: .55rem .85rem .55rem 2.35rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: .875rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus {
  border-color: #ffd13a;
  box-shadow: 0 0 0 3px rgba(255,209,58,.18);
}
.dark .search-input {
  background: #020617;
  border-color: rgba(255,255,255,.1);
  color: #f8fafc;
}
.dark .search-input:focus {
  border-color: #ffd13a;
}

.filter-btn {
  padding: .55rem .85rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: .875rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: border-color .15s, background .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-btn:hover { border-color: #ffd13a; background: #fffae8; }
.dark .filter-btn { background: #020617; border-color: rgba(255,255,255,.1); color: #cbd5e1; }
.dark .filter-btn:hover { border-color: #ffd13a; background: rgba(255,209,58,.06); }
.filter-btn.active { border-color: #ffd13a; color: #a07200; }
.dark .filter-btn.active { border-color: #ffd13a; color: #ffd13a; }

/* Modal mejorado */
.entity-modal {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 32px 96px rgba(2,6,23,.20);
  padding: 1.75rem;
  width: 100%;
  max-width: 42rem;
  max-height: 92vh;
  overflow-y: auto;
}
.dark .entity-modal {
  background: #0f172a;
  border-color: rgba(255,255,255,.1);
}
.entity-modal h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.03em;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid #f1f5f9;
}
.dark .entity-modal h3 { border-color: rgba(255,255,255,.08); }

/* Form fields dentro de modales */
.form-field {
  width: 100%;
  padding: .62rem .85rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: .875rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-field:focus {
  border-color: #ffd13a;
  box-shadow: 0 0 0 3px rgba(255,209,58,.18);
  background: #fff;
}
.dark .form-field {
  background: rgba(2,6,23,.6);
  border-color: rgba(255,255,255,.1);
  color: #f8fafc;
}
.dark .form-field:focus {
  border-color: #ffd13a;
  background: rgba(2,6,23,.95);
}

/* Paginación */
.page-btn {
  padding: .35rem .75rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: .78rem;
  background: #fff;
  transition: background .12s, border-color .12s;
}
.page-btn:hover:not(:disabled) { background: #fffae8; border-color: #ffd13a; }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.dark .page-btn { background: #0f172a; border-color: rgba(255,255,255,.1); color: #cbd5e1; }
.dark .page-btn:hover:not(:disabled) { background: rgba(255,209,58,.08); border-color: #ffd13a; }

/* Skeleton de carga */
.skeleton-row {
  height: 2.4rem;
  border-radius: 10px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.4s infinite;
}
.dark .skeleton-row {
  background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.05) 75%);
  background-size: 200% 100%;
}
@keyframes skeleton-shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
}
.empty-state-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 16px;
  background: #fffae8;
  border: 1.5px solid rgba(255,209,58,.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a07200;
  margin-bottom: .75rem;
}
.dark .empty-state-icon {
  background: rgba(255,209,58,.08);
  border-color: rgba(255,209,58,.2);
  color: #ffd13a;
}

/* Sección header (título + botón) */
.section-toolbar {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
@media (min-width: 640px) {
  .section-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.03em;
}
.section-count {
  font-size: .75rem;
  color: #64748b;
  margin-top: .1rem;
}
.dark .section-count { color: #94a3b8; }

/* Botón export CSV */
.btn-export {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .85rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: .78rem;
  font-weight: 500;
  color: #475569;
  background: #fff;
  transition: background .12s, border-color .12s, color .12s;
}
.btn-export:hover { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; }
.dark .btn-export { background: #0f172a; border-color: rgba(255,255,255,.1); color: #94a3b8; }
.dark .btn-export:hover { background: rgba(255,255,255,.05); color: #fff; }

/* Filter popover */
.filter-popover {
  position: absolute;
  right: 0;
  top: calc(100% + .5rem);
  width: 340px;
  max-width: calc(100vw - 2rem);
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 24px 64px rgba(2,6,23,.15);
  padding: 1rem;
  z-index: 30;
}
.dark .filter-popover {
  background: #0f172a;
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
}

/* ============================================================
   TEMA NEGRO / BLANCO / AMARILLO #ffd13a  — sobrescribe Tailwind
   ============================================================ */

/* Modales: fondo blanco puro en light, negro casi puro en dark */
.bg-white { background-color: #ffffff !important; }
.dark .dark\:bg-gray-900 { background-color: #0d0d0d !important; }
.dark .dark\:bg-gray-800 { background-color: #1a1a1a !important; }
.dark .dark\:bg-gray-700 { background-color: #222222 !important; }
.bg-gray-50 { background-color: #f9f9f9 !important; }
.bg-gray-100 { background-color: #f2f2f2 !important; }
.dark .dark\:bg-gray-800 { background-color: #181818 !important; }

/* Bordes: gris muy sutil → casi negro en dark */
.border-gray-200 { border-color: #e0e0e0 !important; }
.dark .dark\:border-gray-800 { border-color: #2a2a2a !important; }
.dark .dark\:border-gray-700 { border-color: #333333 !important; }

/* Textos grises → negro en light, blanco en dark */
.text-gray-600 { color: #1a1a1a !important; }
.text-gray-500 { color: #444444 !important; }
.dark .dark\:text-gray-400 { color: #cccccc !important; }
.dark .dark\:text-gray-300 { color: #e0e0e0 !important; }

/* Inputs: bordes neutros, foco en amarillo */
input, select, textarea {
  border-color: #d0d0d0;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: #ffd13a !important;
  box-shadow: 0 0 0 3px rgba(255,209,58,.25) !important;
}

/* Botones brand → amarillo con texto negro */
.bg-brand-600, [class~="bg-brand-600"], button.bg-brand-600,
.px-3.py-1\.5.rounded-lg.bg-brand-600 {
  background-color: #ffd13a !important;
  color: #0d0d0d !important;
  font-weight: 600 !important;
  border: none !important;
}
.bg-brand-600:hover, .hover\:bg-brand-700:hover {
  background-color: #e6bb2a !important;
  color: #0d0d0d !important;
}
.text-brand-600 { color: #b89000 !important; }
.dark .dark\:text-brand-400 { color: #ffd13a !important; }

/* Filas de tabla: hover amarillo suave */
table tbody tr:hover {
  background-color: rgba(255,209,58,.07) !important;
}

/* Botón cancelar en modales: negro/blanco limpio */
.rounded-lg.text-gray-600 {
  color: #444 !important;
  background: transparent !important;
}
.rounded-lg.text-gray-600:hover {
  background: #f2f2f2 !important;
  color: #0d0d0d !important;
}
.dark .rounded-lg.dark\:text-gray-400 {
  color: #aaa !important;
}

/* Headers de sección — kicker en amarillo */
.section-kicker {
  color: #ffd13a !important;
  font-weight: 700 !important;
}

/* Badge de nav activo — amarillo con negro */
.nav-active {
  background: #ffd13a !important;
  color: #0d0d0d !important;
  font-weight: 600 !important;
}
.nav-idle:hover {
  background: rgba(255,209,58,.12) !important;
}

/* btn-primary global → amarillo */
.btn-primary {
  background: #ffd13a !important;
  color: #0d0d0d !important;
  font-weight: 600 !important;
  border: none !important;
}
.btn-primary:hover {
  background: #e6bb2a !important;
}

/* Skeleton amarillo suave */
.skeleton, .skeleton-box {
  background: linear-gradient(90deg, #f5eecc 25%, #fff9df 50%, #f5eecc 75%) !important;
  background-size: 200% 100% !important;
}
