/* Sistema visual común para todos los grids, listados y tarjetas del portal. */
:root{
  --collection-bg:#fff;
  --collection-bg-soft:#f8fbfe;
  --collection-line:#d9e4ee;
  --collection-line-hover:#8cb7d8;
  --collection-ink:#173b5f;
  --collection-muted:#667d93;
  --collection-blue:#075f9f;
  --collection-shadow:0 5px 18px rgba(17,55,88,.055);
  --collection-shadow-hover:0 12px 30px rgba(17,68,111,.12);
  --collection-radius:16px;
}

/* Una única superficie visual, con independencia de si el origen es un
   ASPxGridView, un Repeater o un listado construido en servidor. */
.ui-records .ui-record,
.r2-record-card,
.activity-card,
.sv-case-card,
.fluid-declaration-entry,
.ui-guard,
.my-guard,
.sv-list-item,
.gc-event{
  box-sizing:border-box;
  background:var(--collection-bg)!important;
  border:1px solid var(--collection-line)!important;
  border-radius:var(--collection-radius)!important;
  box-shadow:var(--collection-shadow)!important;
  color:var(--collection-ink);
}
.r2-record-card-link,
.sv-case-card,
.ui-guard,
.my-guard,
.sv-list-item,
.gc-event,
.fluid-declaration-entry,
.activity-card,
.ui-records .ui-record{
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease,background-color .16s ease;
}
.r2-record-card-link:hover,
.r2-record-card-link:focus-visible,
.sv-case-card:hover,
.sv-case-card:focus-within,
.ui-guard:hover,
.my-guard:hover,
.sv-list-item:hover,
.gc-event:hover,
.fluid-declaration-entry:hover,
.activity-card:hover,
.ui-records .ui-record:hover{
  border-color:var(--collection-line-hover)!important;
  box-shadow:var(--collection-shadow-hover)!important;
  transform:translateY(-1px);
}

/* Ritmo y separación idénticos en todas las colecciones. */
.ui-records [id$="_DXMainTable"]>tbody,
.r2-card-list,
.activity-card-list,
.sv-case-grid,
.fluid-history,
.ui-guard-list,
.my-guards__list,
.sv-list-items,
.gc-items{
  gap:14px!important;
}

/* ASPxGridView convertido en colección de fichas, sin apariencia tabular. */
.ui-records{
  width:100%!important;
  overflow:visible!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.ui-records [id$="_DXMainTable"],
.ui-records [id$="_DXMainTable"]>tbody{
  display:block!important;
  width:100%!important;
  border:0!important;
  background:transparent!important;
}
.ui-records [id$="_DXMainTable"]>tbody>.ui-record{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:17px 24px!important;
  width:100%!important;
  margin:0 0 14px!important;
  padding:20px 22px!important;
}
.ui-records .ui-record>td{
  display:block!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  color:var(--collection-ink)!important;
  font:600 14px/1.5 "Segoe UI",sans-serif!important;
  white-space:normal!important;
  overflow-wrap:anywhere;
}
.ui-records .ui-record .ui-record-label{
  display:block;
  margin:0 0 4px;
  color:var(--collection-muted);
  font-size:12px;
  font-weight:600;
  line-height:1.35;
  letter-spacing:0;
  text-transform:none;
}
.ui-records .ui-record .ui-record-lead{
  color:var(--collection-blue)!important;
  font-size:17px!important;
  font-weight:700!important;
}
.ui-records .ui-record .ui-record-amount{
  color:#174f79!important;
  font-size:20px!important;
  font-weight:750!important;
  font-variant-numeric:tabular-nums;
}
.ui-records .ui-record .ui-record-actions{
  grid-column:1/-1;
  order:50;
  display:flex!important;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  padding-top:13px!important;
  border-top:1px solid #e9eff5!important;
}
.ui-records .ui-record .ui-record-actions a,
.ui-records .ui-record .ui-record-actions button,
.ui-records .ui-record .ui-record-actions [class*="dxbButton"]{
  border-radius:999px!important;
  font-weight:700!important;
}

/* Un único buscador general. Nunca se muestran filtros por columna. */
.ui-records [class*="FilterRow"],
.ui-records [class*="HeaderFilter"],
.ui-records [class*="Customization"]{
  display:none!important;
}
.ui-records [class*="SearchPanel"]{
  box-sizing:border-box!important;
  margin:0 0 14px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
}
.ui-records [class*="SearchPanel"]>table,
.ui-records [class*="SearchPanel"] table{
  width:min(100%,720px)!important;
  max-width:720px!important;
  min-height:48px;
  margin:0!important;
  padding:4px 7px!important;
  border:1px solid var(--collection-line)!important;
  border-radius:14px!important;
  background:#fff!important;
  box-shadow:var(--collection-shadow)!important;
}
.ui-records [class*="SearchPanel"] input{
  width:100%!important;
  min-height:38px!important;
  padding:7px 10px!important;
  border:0!important;
  outline:0!important;
  background:transparent!important;
  color:var(--collection-ink)!important;
  font:400 15px/1.4 "Segoe UI",sans-serif!important;
  box-shadow:none!important;
}
.ui-records [class*="TitlePanel"]{
  box-sizing:border-box!important;
  margin:0 0 12px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  text-align:left!important;
}
.ui-records [class*="TitlePanel"] [class*="dxbButton"]{
  border-radius:999px!important;
}

/* Paginación y estados vacíos comunes. */
.ui-records [class*="PagerBottomPanel"],
.ui-records [class*="PagerTopPanel"]{
  margin-top:4px!important;
  padding:13px 0!important;
  border:0!important;
  background:transparent!important;
}
.ui-records [class*="Pager"] a,
.ui-records [class*="Pager"] span{
  border-radius:999px!important;
}
.ui-records [class*="EmptyDataRow"] td,
.ui-records [class*="EmptyDataRow"]{
  box-sizing:border-box!important;
  width:100%!important;
  padding:34px 20px!important;
  border:1px dashed #bfd0df!important;
  border-radius:16px!important;
  background:#fff!important;
  color:var(--collection-muted)!important;
  text-align:center!important;
}

/* Estados funcionales: misma semántica pastel en cualquier listado. */
.ui-records .ui-record.is-approved,
.activity-card.is-approved,
.fluid-declaration-entry.is-approved,
.fluid-declaration-entry.approved{
  background:#f2faf4!important;
  border-color:#c8e5d0!important;
  border-left:4px solid #4a9b62!important;
}
.ui-records .ui-record.is-denied,
.activity-card.is-denied,
.fluid-declaration-entry.is-denied,
.fluid-declaration-entry.denied{
  background:#fff4f4!important;
  border-color:#efc8cc!important;
  border-left:4px solid #c54e57!important;
}

/* Metadatos y acciones coherentes en los listados hechos a medida. */
.r2-record-facts dt,
.activity-card-facts dt,
.sv-case-meta dt,
.fluid-declaration-entry dt{
  color:var(--collection-muted)!important;
  font-size:12px!important;
  font-weight:600!important;
  text-transform:none!important;
}
.r2-record-facts dd,
.activity-card-facts dd,
.sv-case-meta dd,
.fluid-declaration-entry dd{
  color:var(--collection-ink)!important;
  font-size:14px!important;
  font-weight:600!important;
}
.r2-card-arrow,
.sv-case-arrow{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:50%;
  background:#edf5fc;
  color:var(--collection-blue);
}
.r2-record-card-link:hover .r2-card-arrow,
.sv-case-card:hover .sv-case-arrow{
  background:var(--collection-blue);
  color:#fff;
}

@media (min-width:1500px){
  .ui-records [id$="_DXMainTable"]>tbody>.ui-record{grid-template-columns:repeat(4,minmax(0,1fr));}
}
@media (max-width:980px){
  .ui-records [id$="_DXMainTable"]>tbody>.ui-record{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:620px){
  .ui-records [id$="_DXMainTable"]>tbody>.ui-record{
    grid-template-columns:minmax(0,1fr);
    gap:14px!important;
    padding:17px 16px!important;
    border-radius:13px!important;
  }
  .ui-records [class*="SearchPanel"]>table,
  .ui-records [class*="SearchPanel"] table{width:100%!important;max-width:none!important;}
  .ui-records .ui-record .ui-record-actions{gap:10px;}
  .ui-records .ui-record .ui-record-actions a,
  .ui-records .ui-record .ui-record-actions button{min-height:42px;}
}
@media (prefers-reduced-motion:reduce){
  .ui-records .ui-record,.r2-record-card-link,.sv-case-card,.ui-guard,.my-guard,.sv-list-item,.gc-event,.fluid-declaration-entry,.activity-card{transition:none!important;}
}
