/* Shared list language: soft headers, fine separators and compact controls. */
:root {
  --list-header: #f7f7f8;
  --list-row-hover: #fafafa;
  --list-success: #ecfdf5;
  --list-success-text: #047857;
  --list-warning: #fffbeb;
  --list-warning-text: #92400e;
  --list-danger: #fff1f2;
  --list-danger-text: #be123c;
  --list-info: #eff6ff;
  --list-info-text: #1d4ed8;
}
.dark {
  --list-header: #232326;
  --list-row-hover: #202023;
  --list-success: #102b23;
  --list-success-text: #6ee7b7;
  --list-warning: #302716;
  --list-warning-text: #fcd34d;
  --list-danger: #321c24;
  --list-danger-text: #fda4af;
  --list-info: #1b263a;
  --list-info-text: #93c5fd;
}
#app-layout .list-table {
  border-collapse: separate; border-spacing: 0; width: 100%;
  background: var(--card); font-size: 0.8125rem;
}
#app-layout .list-table thead { background: var(--list-header); }
#app-layout .list-table th {
  height: 44px; padding: 0.75rem 1rem; border: 0;
  color: var(--muted-foreground); font-size: 0.75rem; font-weight: 500;
  text-transform: none; letter-spacing: normal; white-space: nowrap;
}
#app-layout .list-table th:first-child { border-radius: 8px 0 0 8px; }
#app-layout .list-table th:last-child { border-radius: 0 8px 8px 0; }
#app-layout .list-table tbody tr { background: transparent; border: 0; }
#app-layout .list-table tbody tr:hover { background: var(--list-row-hover); }
#app-layout .list-table td {
  height: 56px; padding: 0.75rem 1rem; vertical-align: middle;
  border: 0; border-bottom: 1px solid var(--border);
  color: var(--foreground); font-size: 0.8125rem; font-weight: 400;
}
#app-layout .list-table td.text-right { font-variant-numeric: tabular-nums; }
#app-layout .list-table td[colspan] { height: auto; padding: 2rem 1rem; }
#app-layout .list-table td:last-child:not([colspan]) { white-space: nowrap; }
#app-layout .list-table td .rounded-full:not(img),
#app-layout .list-table td [data-slot="badge"] {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem 0.625rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  font-size: 0.6875rem; font-weight: 500; line-height: 1.25; white-space: nowrap;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.03);
}
#app-layout .list-table td span[class*="bg-green-"],
#app-layout .list-table td span[class*="bg-emerald-"] { background: var(--list-success); color: var(--list-success-text); }
#app-layout .list-table td span[class*="bg-yellow-"],
#app-layout .list-table td span[class*="bg-amber-"] { background: var(--list-warning); color: var(--list-warning-text); }
#app-layout .list-table td span[class*="bg-red-"],
#app-layout .list-table td [data-slot="badge"].bg-destructive { background: var(--list-danger); color: var(--list-danger-text); }
#app-layout .list-table td span[class*="bg-blue-"] { background: var(--list-info); color: var(--list-info-text); }
#app-layout .list-toolbar {
  padding: 0; background: transparent; border: 0; border-radius: 0;
  box-shadow: none; margin-bottom: 1rem;
}
#app-layout .list-toolbar button,
#app-layout .list-toolbar input,
#app-layout .list-toolbar select {
  min-height: 34px; height: 34px; border-radius: 7px; font-size: 0.75rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--input);
}
#app-layout .list-toolbar input[type="text"] { background: var(--card); }
#app-layout .list-toolbar select { background-color: var(--card); padding-top: 0; padding-bottom: 0; }
#app-layout .list-toolbar button:not(.bg-primary) { background: var(--card); color: var(--foreground); }
#app-layout .list-toolbar-search { margin-left: auto; }
#app-layout .list-person-pill {
  width: fit-content; max-width: 100%; padding: 0.25rem 0.625rem 0.25rem 0.25rem;
  border: 1px solid var(--border); border-radius: 999px;
  box-shadow: var(--shadow-sm); background: var(--card);
}
#app-layout .list-person-pill p { font-size: 0.75rem; line-height: 1.25; }
#app-layout .list-person-pill p:empty { display: none; }
#app-layout .list-action-trigger { width: 30px; height: 30px; color: var(--muted-foreground); }
.list-action-menu { min-width: 170px; border-color: var(--border); background: var(--popover); color: var(--popover-foreground); }
.list-action-menu .ui-icon { font-size: 1rem; }
@media (max-width: 768px) {
  #app-layout .list-toolbar-search { margin-left: 0; flex-wrap: wrap; width: 100%; }
  #app-layout .list-toolbar input { max-width: 100%; }
  #app-layout .list-toolbar > .flex { gap: 0.75rem; }
  #app-layout .list-table th, #app-layout .list-table td { padding-left: 0.75rem; padding-right: 0.75rem; }
}
#app-layout .list-table tbody tr.font-bold td {
  background: var(--muted); font-weight: 600;
}
.list-action-menu [role="menuitem"] { padding: 0.5rem 0.625rem; font-size: 0.8125rem; gap: 0.5rem; }
.list-action-menu [role="menuitem"][data-highlighted] { background: var(--accent); }
.list-action-menu [role="menuitem"][data-disabled] { opacity: 0.5; }

/* Paginación compartida. pagination.js mete el componente (.pagination-wrapper)
   dentro del contenedor, que también lleva .pagination-wrapper: salían dos cajas
   anidadas. El contenedor queda transparente y solo el interior se pinta, con
   tokens. modern-style.css usa !important, de ahí que aquí también. */
#app-layout .pagination-wrapper.hidden { display: none !important; }
#app-layout .pagination-wrapper:has(> .pagination-wrapper) {
  display: block !important; padding: 0 !important; background: transparent !important;
  border: 0 !important; box-shadow: none !important;
}
#app-layout .pagination-wrapper {
  background: var(--card) !important; border-top: 1px solid var(--border) !important;
  box-shadow: none !important; padding: 0.875rem 1.25rem !important;
}
#app-layout .pagination-text { color: var(--muted-foreground) !important; font-size: 0.8125rem !important; }
#app-layout .pagination-from, #app-layout .pagination-to, #app-layout .pagination-total { color: var(--foreground) !important; font-weight: 500 !important; }
#app-layout .pagination-btn, #app-layout .pagination-number {
  width: 2rem !important; min-width: 2rem !important; height: 2rem !important; border-radius: 6px !important;
  background: var(--card) !important; border: 1px solid var(--border) !important; color: var(--foreground) !important;
  box-shadow: none !important; transform: none !important; font-size: 0.8125rem !important; font-weight: 500 !important;
}
#app-layout .pagination-btn:hover:not(:disabled), #app-layout .pagination-number:hover:not(:disabled):not(.active) {
  background: var(--accent) !important; border-color: var(--input) !important; color: var(--foreground) !important; box-shadow: none !important;
}
#app-layout .pagination-number.active {
  background: var(--primary) !important; border-color: var(--primary) !important; color: var(--primary-foreground) !important; box-shadow: none !important;
}
#app-layout .pagination-btn:disabled { background: transparent !important; color: var(--muted-foreground) !important; opacity: 0.5 !important; }
#app-layout .pagination-ellipsis, #app-layout .pagination-per-page-label { color: var(--muted-foreground) !important; font-size: 0.8125rem !important; }
#app-layout .pagination-per-page-select {
  height: 2rem !important; padding: 0 1.75rem 0 0.625rem !important; border-radius: 6px !important; font-size: 0.8125rem !important;
  background-color: var(--card) !important; border: 1px solid var(--border) !important; color: var(--foreground) !important; box-shadow: none !important;
}
/* la activa va disabled: sin la opacidad de "deshabilitado" */
#app-layout .pagination-number.active { opacity: 1 !important; cursor: default !important; }
/* el shorthand "background" del modo oscuro reseteaba posición y repetición: la flecha salía en mosaico */
#app-layout .pagination-per-page-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E") !important;
  background-position: right 0.375rem center !important; background-repeat: no-repeat !important; background-size: 1rem !important;
}
#app-layout .pagination-per-page-select:hover { border-color: var(--input) !important; }
#app-layout .pagination-per-page-select:focus { border-color: var(--ring) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent) !important; outline: none !important; }
