:root {
    --adm-ink: #1f2937;
    --adm-muted: #6b7280;
    --adm-border: #e5e7eb;
    --adm-sidebar: #111827;
    --adm-sidebar-text: #9ca3af;
    --adm-sidebar-active: #0f766e;
    --adm-bg: #f3f4f6;
}

* {
    box-sizing: border-box;
}

body.adm-body {
    margin: 0;
    background: var(--adm-bg);
    color: var(--adm-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: var(--adm-sidebar-active);
}

/* Barra superior */
.adm-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--adm-ink);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 20;
}

.adm-brand {
    font-weight: 700;
    font-size: 17px;
    color: #fff;
}

.adm-brand span {
    color: #34d399;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.adm-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.adm-user {
    color: #d1d5db;
    font-size: 13px;
}

.adm-logout {
    color: #9ca3af;
    font-size: 16px;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}

.adm-logout:hover {
    color: #fff;
}

/* Estructura con sidebar */
.adm-shell {
    display: flex;
    margin-top: 56px;
    min-height: calc(100vh - 56px);
}

.adm-sidebar {
    width: 210px;
    flex: 0 0 210px;
    background: var(--adm-sidebar);
    padding: 16px 10px;
    transition: width .22s ease, flex .22s ease, padding .22s ease;
    overflow: hidden;
}

.adm-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--adm-sidebar-text);
    margin-bottom: 4px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.adm-sidebar a i {
    width: 18px;
    text-align: center;
}

.adm-sidebar a:hover {
    background: #1f2937;
    color: #fff;
}

.adm-sidebar a.active {
    background: var(--adm-sidebar-active);
    color: #fff;
}

/* Sidebar colapsado */
.adm-sidebar--collapsed {
    width: 60px;
    flex: 0 0 60px;
    padding: 16px 6px;
}
.adm-sidebar--collapsed a {
    justify-content: center;
    padding: 10px;
    gap: 0;
    position: relative;
}
.adm-sidebar--collapsed a i {
    width: auto;
    margin: 0;
    font-size: 16px;
}
.adm-sidebar--collapsed a span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
/* Tooltip también con teclado, no solo con ratón */
.adm-sidebar--collapsed a:hover::after,
.adm-sidebar--collapsed a:focus-visible::after {
    opacity: 1;
}
/* Tooltip on hover when collapsed */
.adm-sidebar--collapsed a::after {
    content: attr(data-tip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    z-index: 30;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
}
.adm-sidebar--collapsed a:hover::after {
    opacity: 1;
}
.adm-toggle-btn {
    background: none;
    border: none;
    color: #d1d5db;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    border-radius: 4px;
    transition: color .15s, background .15s;
}
.adm-toggle-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
}

.adm-main {
    flex: 1;
    padding: 24px 28px;
    min-width: 0;
}

/* Encabezado de cada seccion */
.adm-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.adm-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.adm-subtitle {
    color: #4b5563;
    margin: 2px 0 0;
    font-size: 13px;
}

/* Buscador de las tablas: texto + filtro de estado en un solo formulario */
.adm-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.adm-search-input {
    position: relative;
    display: flex;
    align-items: center;
}

.adm-search-input i {
    position: absolute;
    left: 10px;
    color: var(--adm-muted);
    font-size: 13px;
    pointer-events: none;
}

.adm-search-input input {
    padding: 7px 10px 7px 30px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    min-width: 230px;
    font-size: 14px;
}

.adm-search select {
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.adm-search-info {
    color: var(--adm-muted);
    font-size: 13px;
}

@media (max-width: 640px) {
    .adm-search,
    .adm-search-input,
    .adm-search-input input {
        width: 100%;
    }
}

/* Tarjetas */
.adm-card {
    background: #fff;
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
}

.adm-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--adm-border);
}

/* Estadisticas del resumen */
.adm-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.adm-stat {
    background: #fff;
    border: 1px solid var(--adm-border);
    border-left: 4px solid var(--adm-sidebar-active);
    border-radius: 6px;
    padding: 16px;
}

.adm-stat .num {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.adm-stat .lbl {
    color: var(--adm-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tablas */
.adm-table {
    width: 100%;
    border-collapse: collapse;
}

.adm-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--adm-muted);
    border-bottom: 2px solid var(--adm-border);
    padding: 8px 10px;
    white-space: nowrap;
}

.adm-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--adm-border);
    vertical-align: top;
}

.adm-table tr:hover td {
    background: #fafafa;
}

/* Botones sobrios */
.adm-btn {
    display: inline-block;
    border: 1px solid var(--adm-border);
    background: #fff;
    color: var(--adm-ink);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.adm-btn:hover {
    border-color: var(--adm-sidebar-active);
    color: var(--adm-sidebar-active);
}

.adm-btn-primary {
    background: var(--adm-sidebar-active);
    border-color: var(--adm-sidebar-active);
    color: #fff;
}

.adm-btn-primary:hover {
    background: #0b5d57;
    color: #fff;
}

.adm-btn-danger {
    color: #dc2626;
    border-color: #fecaca;
}

.adm-btn-danger:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.adm-btn-sm {
    padding: 4px 9px;
    font-size: 12px;
}

.adm-btn i {
    margin-right: 5px;
}

/* Formularios */
.adm-form label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin: 12px 0 4px;
}

.adm-form input[type="text"],
.adm-form input[type="email"],
.adm-form input[type="password"],
.adm-form input[type="number"],
.adm-form textarea,
.adm-form select {
    width: 100%;
    max-width: 460px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.adm-form textarea {
    min-height: 90px;
}

.adm-form .adm-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.adm-form .adm-check input {
    width: auto;
}

/* Bloque de imagen de producto: vista previa + controles de subida. */
.adm-img {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
    max-width: 560px;
    margin-top: 4px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.adm-img-prev {
    flex: 0 0 auto;
    width: 118px;
    height: 118px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adm-img-prev img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* El atributo hidden pierde contra un display explicito del autor: sin esto,
   `img.hidden = true` en el JS no ocultaria nada. */
.adm-img-prev img[hidden],
.adm-img-empty[hidden] {
    display: none;
}

.adm-img-empty {
    color: #9ca3af;
    font-size: 12px;
    text-align: center;
    padding: 8px;
    line-height: 1.4;
}

.adm-img-empty i {
    display: block;
    font-size: 20px;
    margin-bottom: 6px;
    color: #d1d5db;
}

.adm-img-side {
    flex: 1 1 240px;
    min-width: 220px;
}

.adm-img-side input[type="file"] {
    display: block;
    width: 100%;
    font-size: 13px;
    padding: 8px;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    background: #fff;
    min-height: 44px;
}

.adm-img-file {
    margin: 8px 0 0;
    font-size: 12px;
    color: #374151;
    overflow-wrap: anywhere;
}

.adm-img-error {
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: #b91c1c;
}

.adm-img-alt {
    margin-top: 10px;
    font-size: 12px;
}

.adm-img-alt summary {
    cursor: pointer;
    color: #0f766e;
    min-height: 24px;
    display: flex;
    align-items: center;
}

/* Miniatura en la tabla del catalogo. */
.adm-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: block;
}

.adm-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    font-size: 16px;
}

/* Badge de estado */
.adm-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.adm-badge-ok {
    background: #d1fae5;
    color: #065f46;
}

.adm-badge-off {
    background: #e5e7eb;
    color: #374151;
}

.adm-badge-warn {
    background: #fef3c7;
    color: #92400e;
}

.adm-badge-muted {
    background: #e0e7ff;
    color: #3730a3;
}

/* Login */
.adm-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--adm-sidebar);
    padding: 20px;
}

.adm-login-card {
    background: #fff;
    border-radius: 10px;
    padding: 34px 30px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.adm-login-card .adm-brand-login {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.adm-login-card .adm-brand-login i {
    color: var(--adm-sidebar-active);
}

.adm-login-card .adm-brand-login span {
    color: var(--adm-sidebar-active);
    font-size: 12px;
    display: block;
    margin-top: 2px;
}

.adm-login-err {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 9px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 13px;
}

/* Utilidades */
.adm-text-muted {
    color: var(--adm-muted);
    font-size: 12px;
}

.adm-alert {
    border-radius: 6px;
}

.adm-action-row {
    display: flex;
    gap: 6px;
}

/* Integraciones */
.uq-int-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--adm-ink);
}
.uq-int-input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--adm-border);
    border-radius: 6px;
    font-size: 13px;
    font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
    background: #fff;
}
.uq-int-input:focus {
    outline: none;
    border-color: var(--adm-sidebar-active);
    box-shadow: 0 0 0 2px rgba(15,118,110,.15);
}
.uq-int-eye {
    flex-shrink: 0;
    width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--adm-border);
    border-radius: 6px;
    background: #f9fafb;
    cursor: pointer;
    color: var(--adm-muted);
}
.uq-int-eye:hover {
    background: #e5e7eb;
    color: var(--adm-ink);
}
.uq-int-desc {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: var(--adm-muted);
}
.adm-badge-warn {
    background: #fef3c7;
    color: #92400e;
}
.uq-int-del {
    display: inline;
    margin: 0;
    padding: 0;
}
.uq-int-del-btn {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 12px;
    line-height: 1;
    border-radius: 4px;
}
.uq-int-del-btn:hover {
    color: #dc2626;
    background: #fef2f2;
}
/* Valor revelado bajo demanda: se muestra en un bloque propio, nunca en el
   atributo value del input, para que no quede en el HTML cacheado. */
.uq-int-revealed {
    margin-top: 6px;
    padding: 8px 10px;
    background: #fffbeb;
    border: 1px dashed #f59e0b;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: #78350f;
    word-break: break-all;
    white-space: pre-wrap;
}
.uq-int-error {
    margin-top: 6px;
    padding: 6px 9px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.4;
    color: #991b1b;
}
.uq-int-error code {
    font-size: 10px;
    background: #fee2e2;
    padding: 0 3px;
    border-radius: 3px;
}
.adm-bulk {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.adm-bulk-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}
.adm-bulk-form select {
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}
.adm-bulk-form select:disabled + .adm-btn,
.adm-bulk-form select:disabled {
    opacity: .6;
}
.adm-bulk-check {
    width: 16px;
    height: 16px;
    accent-color: var(--adm-accent, #2563eb);
    cursor: pointer;
}
.adm-table thead input[type="checkbox"][data-check-all] {
    width: 16px;
    height: 16px;
    accent-color: var(--adm-accent, #2563eb);
    cursor: pointer;
}
.adm-bulk-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}
.adm-bulk-btns .adm-btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* ---------------------------------------------------------------------------
   Bloque QR del panel (It54).

   El panel carga SOLO admin.css: ni style.css ni switch-greenVet.css, donde
   viven .uquedi-qr-box y .newQrGen-Uquedi. Por eso aquí se replican los mismos
   selectores data-uq-* con el teal del panel y su fallback, en lugar de
   arrastrar la hoja del sitio público a un layout que no la usa.
   --------------------------------------------------------------------------- */
.adm-qr-box {
    display: inline-block;
    max-width: 300px;
    background: #fff;
    border: 1px solid var(--bs-gray-400);
    border-radius: 15px;
    padding: 10px;
    box-shadow: 1px 1px black;
}

.adm-qr-box,
#qrcode img,
#qrcode canvas {
    max-width: 100%;
}
#qrcode img,
#qrcode canvas {
    height: auto;
    transition: opacity 180ms ease;
}

.uquedi-qr-empty {
    min-width: 200px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.uquedi-qr-empty::before {
    content: "Genera un código para ver el QR";
    max-width: 180px;
    color: #6c757d;
    font-size: 0.875rem;
    text-align: center;
}

[data-uq-version]:focus,
[data-uq-version]:focus-visible {
    outline: 3px solid var(--adm-sidebar-active, #0f766e);
    outline-offset: 2px;
    border-color: var(--adm-sidebar-active, #0f766e);
    box-shadow: none;
}

.adm-btn:focus-visible,
.adm-btn-sm:focus-visible {
    outline: 3px solid var(--adm-sidebar-active, #0f766e);
    outline-offset: 2px;
}

/* Suelo incondicional de 24 px: WCAG 2.2 SC 2.5.8 (AA) no distingue punteros y sin
   él el bloque solo cumpliría por la excepción de espaciado, que es frágil. */
[data-uq-version],
[data-uq-descargar] {
    min-height: 24px;
}

/* Sube a los 44 px recomendados (SC 2.5.5, AAA) solo con puntero grueso. */
@media (pointer: coarse) {
    [data-uq-version],
    [data-uq-descargar] {
        min-height: 44px;
    }
}

/* Cola de trabajo del resumen (It157): lo que espera accion va antes que las
   cifras. Cuando no hay nada, se dice explicitamente en lugar de mostrar ceros. */
.adm-atencion {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #d97706;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.adm-atencion--ok { border-left-color: #10b981; }
.adm-atencion-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.adm-atencion-cab h2 { font-size: 15px; font-weight: 700; margin: 0; color: #111827; }
.adm-atencion-total {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  background: #fef3c7; color: #92400e; font-size: 12.5px; font-weight: 700;
}
.adm-atencion-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.adm-atencion-lista li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-atencion-n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; border-radius: 6px;
  background: #f3f4f6; font-weight: 700; font-size: 13px; color: #111827;
}
.adm-atencion-txt { flex: 1 1 220px; font-size: 13.5px; color: #374151; }
.adm-atencion-vacio { margin: 0; font-size: 13.5px; color: #6b7280; }
.adm-stat--vacio .num { color: #9ca3af; }
.adm-stat-nota { font-size: 10.5px; text-transform: none; letter-spacing: 0; color: #9ca3af; }

/* Resumen de tarjetas (admin/codigos): cuatro cifras en fila, dos por fila en movil. */
.adm-mini-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.adm-mini-stats > div {
    text-align: center;
    min-width: 80px;
}

@media (max-width: 640px) {
    .adm-mini-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 10px;
    }

    .adm-mini-stats > div {
        min-width: 0;
    }
}

/* ---------------------------------------------------------------------------
   Panel en movil y tableta (It163).

   En escritorio la barra lateral es una columna fija. Por debajo de 900 px no
   cabe: pasa a ser un cajon que se abre con el mismo boton de la barra
   superior, se cierra al tocar el fondo, la X o una seccion, y bloquea el
   scroll de la pagina mientras esta abierto. Las tablas se desplazan en
   horizontal dentro de .table-responsive en vez de romper la tarjeta.
   --------------------------------------------------------------------------- */

/* Boton de cierre del cajon: solo existe en movil. */
.adm-sidebar-cerrar {
    display: none;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #374151;
    border-radius: 6px;
    background: #1f2937;
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.adm-sidebar-cerrar:hover {
    color: #fff;
    background: #374151;
}

/* Fondo oscuro del cajon. */
.adm-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .55);
    z-index: 18;
}

@media (max-width: 900px) {
    .adm-topbar {
        padding: 0 12px;
        gap: 10px;
    }

    .adm-topbar > div:first-child {
        min-width: 0;
    }

    .adm-brand {
        font-size: 16px;
        white-space: nowrap;
    }

    .adm-topbar-right {
        gap: 10px;
    }

    .adm-shell {
        display: block;
        min-height: calc(100vh - 56px);
    }

    .adm-sidebar,
    .adm-sidebar--collapsed {
        position: fixed;
        top: 56px;
        bottom: 0;
        left: 0;
        width: min(84vw, 290px);
        padding: 12px 10px calc(16px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform .22s ease, visibility 0s linear .22s;
        box-shadow: 0 16px 36px rgba(0, 0, 0, .35);
        z-index: 19;
    }

    .adm-sidebar.adm-sidebar--open {
        transform: translateX(0);
        visibility: visible;
        transition: transform .22s ease, visibility 0s;
    }

    /* El modo colapsado no aplica en movil: el cajon siempre muestra texto. */
    .adm-sidebar--collapsed a {
        justify-content: flex-start;
        padding: 10px 12px;
        gap: 10px;
        position: static;
    }

    .adm-sidebar--collapsed a i {
        width: 18px;
        margin: 0;
        font-size: inherit;
    }

    .adm-sidebar--collapsed a span {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip-path: none;
        white-space: normal;
    }

    .adm-sidebar--collapsed a::after {
        display: none;
    }

    .adm-sidebar-cerrar {
        display: flex;
    }

    .adm-backdrop:not([hidden]) {
        display: block;
    }

    body.adm-nav-open {
        overflow: hidden;
    }

    .adm-main {
        padding: 18px 16px 32px;
    }

    .adm-head {
        margin-bottom: 16px;
    }

    .adm-title {
        font-size: 20px;
    }

    /* Las tarjetas no deben permitir que una tabla ancha las estire. */
    .adm-card {
        padding: 15px;
        overflow-wrap: anywhere;
    }

    .adm-table {
        font-size: 13px;
    }

    /* La tabla usa su ancho natural (y como minimo el de la tarjeta): si no
       cabe, .table-responsive la desplaza en horizontal en lugar de aplastar
       columnas y partir palabras. */
    .table-responsive > .adm-table {
        width: max-content;
        min-width: 100%;
    }

    /* Las tablas Bootstrap del panel (bajas, anuncios, marquee, sugerencias)
       no llevan .adm-table; al menos las cabeceras no se parten letra a letra
       y la tabla conserva un ancho legible antes de desplazarse. */
    .table-responsive > table > thead th {
        white-space: nowrap;
    }

    /* Solo las tablas con muchas columnas conservan un ancho legible antes de
       desplazarse; las cortas siguen ajustandose a la tarjeta. */
    .table-responsive > .table.adm-table-ancha {
        min-width: 520px;
    }

    /* Sombra en los bordes que solo se ve cuando queda contenido por deslizar:
       avisa de que la tabla se puede mover sin añadir una nota en cada vista. */
    .table-responsive {
        background:
            linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) left center,
            linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right center,
            radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .13), transparent) left center,
            radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .13), transparent) right center;
        background-repeat: no-repeat;
        background-color: #fff;
        background-size: 40px 100%, 40px 100%, 12px 100%, 12px 100%;
        background-attachment: local, local, scroll, scroll;
    }

    .adm-table th,
    .adm-table td {
        padding: 8px;
    }

    .adm-table td {
        white-space: nowrap;
    }

    .adm-action-row {
        align-items: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .adm-topbar {
        padding: 0 10px;
    }

    .adm-brand span {
        display: none;
    }

    .adm-user {
        display: none;
    }

    .adm-main {
        padding: 14px 12px 28px;
    }

    .adm-title {
        font-size: 19px;
    }

    .adm-card {
        padding: 13px;
        border-radius: 7px;
    }

    .adm-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 16px;
    }

    .adm-stat {
        padding: 12px;
    }

    .adm-stat .num {
        font-size: 22px;
    }

    /* Acciones en lote apiladas: el select y los botones caben sin cortarse. */
    .adm-bulk {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px;
    }

    .adm-bulk-form {
        width: 100%;
    }

    .adm-bulk-form select {
        flex: 1 1 100%;
        width: 100%;
    }

    .adm-bulk-btns {
        flex-wrap: wrap;
    }

    /* El cajon de subida de imagen no puede imponer 220 px de minimo. */
    .adm-img {
        padding: 10px;
    }

    .adm-img-side {
        min-width: 0;
    }

    /* iOS hace zoom al enfocar un campo de menos de 16 px. */
    .adm-form input[type="text"],
    .adm-form input[type="email"],
    .adm-form input[type="password"],
    .adm-form input[type="number"],
    .adm-form input[type="search"],
    .adm-form textarea,
    .adm-form select,
    .adm-search-input input,
    .adm-search select,
    .adm-bulk-form select {
        font-size: 16px;
    }

    .adm-search {
        gap: 6px;
    }

    .adm-search-input input {
        min-width: 0;
    }

    .adm-search .adm-btn {
        flex: 1 1 auto;
    }
}

/* En pantallas muy estrechas las cifras van de una en una. */
@media (max-width: 380px) {
    .adm-stats {
        grid-template-columns: 1fr;
    }
}

/* Objetivos tactiles: 44 px con dedo, sin engordar el escritorio. */
@media (pointer: coarse) {
    .adm-toggle-btn,
    .adm-logout {
        min-width: 44px;
        min-height: 44px;
    }

    .adm-sidebar-cerrar {
        min-height: 44px;
    }

    .adm-sidebar a {
        min-height: 44px;
    }

    .adm-btn,
    .adm-btn-sm,
    .adm-search .adm-btn {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

