/* ★ 10-nov (local) · admin.css — PANEL DE FÁBRICA (lo monta admin.js). Solo dentro de #viewAdmin.adm-nuevo.
   ★ 19-nov (local · diseño «V3» de Ainoha): cabecera negra propia, menú lateral sin iconos agrupado, fondos claros, paneles blancos,
   detalles en bronce, títulos contenidos. Lista arriba y el detalle del elegido debajo; la ficha del cliente es una página con pestañas. */
.adm-nuevo {
  --ad-text: #22211F; --ad-page: #F8F7F4; --ad-surface: #FFFFFF; --ad-muted: #62605B; --ad-border: #E8E4DD;
  --ad-accent: #896223; --ad-accent-h: #73511B; --ad-selected: #EAE2D4; --ad-soft: #F3EFE7; --ad-focus: #2864B4; --ad-alerta: #B3261E;
  background: var(--ad-page); color: var(--ad-text); font-family: "Inter", Arial, sans-serif;
}
.adm-nuevo .adm-ico { width: 20px; height: 20px; flex: none; display: block; }
.adm-nuevo a:focus-visible, .adm-nuevo button:focus-visible, .adm-nuevo summary:focus-visible, .adm-nuevo input:focus-visible,
.adm-nuevo select:focus-visible, .adm-nuevo textarea:focus-visible, .adm-nuevo tr:focus-visible { outline: 2px solid var(--ad-focus); outline-offset: 2px; }
.adm-nuevo .admin-head, .adm-nuevo #adminTabs { display: none !important; }
.adm-nuevo .adm-oculto { display: none !important; }
.adm-nuevo [hidden] { display: none !important; }

/* ---------- cabecera negra del panel (la barra de la web se esconde mientras se ve el panel) ---------- */
body.adm-vista .topbar { display: none !important; }
.adm-top { position: sticky; top: 0; z-index: 60; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; height: 64px; padding: 0 32px;
  background: #151412; color: #fff; box-sizing: border-box; }
.adm-top__marca { justify-self: start; display: flex; flex-direction: column; line-height: 1; color: #fff !important; text-decoration: none !important; }
.adm-top__marca b { font: 600 17px/1 "Inter", Arial, sans-serif; letter-spacing: 3px; }
.adm-top__marca small { margin-top: 4px; font: 500 9px/1 "Inter", Arial, sans-serif; letter-spacing: 2.5px; color: #C9AD7C; }
.adm-top__panel { margin: 0 !important; font: 500 11px/16px "Inter", Arial, sans-serif; letter-spacing: 2.5px; text-transform: uppercase; color: #D8D2C7; }
.adm-top__yo { position: relative; justify-self: end; min-width: 0; }
.adm-top__btn { display: inline-flex; align-items: center; gap: 8px; max-width: 280px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: #fff; font: 500 14px/20px "Inter", Arial, sans-serif; cursor: pointer; }
.adm-top__btn:hover { background: rgba(255, 255, 255, .08); }
.adm-top__btn .adm-ico { width: 16px; height: 16px; color: #C9AD7C; }
.adm-top__nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-top__menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: 8px; background: #fff; color: var(--ad-text); border: 1px solid var(--ad-border); border-radius: 8px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); z-index: 70; }
.adm-top__mail { margin: 4px 8px 8px !important; font-size: 12.5px; color: var(--ad-muted); overflow-wrap: anywhere; }
.adm-top__salir { width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--ad-text); font: 500 14px/20px "Inter", Arial, sans-serif; text-align: left; cursor: pointer; }
.adm-top__salir:hover { background: var(--ad-soft); }

/* ---------- estructura ---------- */
.adm-lay { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: stretch; min-height: calc(100dvh - var(--adm-top, 64px)); }
.adm-nuevo .admin-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 40px 64px; gap: 20px; min-width: 0; box-sizing: border-box; }
.adm-nuevo .admin-page { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---------- menú lateral ---------- */
.adm-side { background: var(--ad-surface); border-right: 1px solid var(--ad-border); min-width: 0; }
.adm-side__in { position: sticky; top: var(--adm-top, 64px); max-height: calc(100dvh - var(--adm-top, 64px)); overflow: hidden auto; scrollbar-width: thin; display: flex; flex-direction: column; padding: 12px 0 16px; box-sizing: border-box; }
.adm-side__nav { display: flex; flex-direction: column; }
.adm-side__g { margin: 18px 20px 4px 32px !important; font: 600 10px/16px "Inter", Arial, sans-serif !important; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ad-muted); }
.adm-side__it { display: flex; align-items: center; gap: 12px; min-height: 40px; margin: 0 16px; padding: 8px 16px; border: 0; border-radius: 6px; background: none;
  color: var(--ad-text) !important; font: 400 14px/20px "Inter", Arial, sans-serif; text-align: left; text-decoration: none !important; cursor: pointer; transition: background-color .15s, color .15s; box-sizing: border-box; }
.adm-side__it > span { flex: 1 1 auto; min-width: 0; }
.adm-side__it:hover { background: var(--ad-soft); }
.adm-side__it.is-on { background: var(--ad-selected); color: var(--ad-accent) !important; font-weight: 600; }
.adm-n { flex: none; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--ad-soft); color: var(--ad-accent); font: 600 11px/20px "Inter", Arial, sans-serif; text-align: center; box-sizing: border-box; }
.adm-side__it.is-on .adm-n { background: #fff; }
.adm-n:empty { display: none; }
.adm-side__pie { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--ad-border); }
.adm-side__salir { width: calc(100% - 32px); color: var(--ad-muted) !important; }

/* ---------- cabecera de cada apartado ---------- */
.adm-cab { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.adm-cab__eye, .adm-eye { margin: 0 0 6px !important; font: 600 10.5px/16px "Inter", Arial, sans-serif; letter-spacing: 1.6px; text-transform: uppercase; color: var(--ad-accent); }
.adm-cab__tit { margin: 0 !important; font: 600 30px/38px "Inter", Arial, sans-serif !important; letter-spacing: -.01em; color: var(--ad-text); overflow-wrap: anywhere; }
.adm-cab__sub { margin: 4px 0 0 !important; color: var(--ad-muted); font-size: 14px; line-height: 20px; max-width: 720px; }
.adm-cab__acc:empty { display: none; }
.adm-h2 { margin: 0 !important; font: 600 18px/26px "Inter", Arial, sans-serif !important; color: var(--ad-text); overflow-wrap: anywhere; }
.adm-sub { display: block; margin: 2px 0 0; color: var(--ad-muted); font-size: 12.5px; line-height: 17px; font-weight: 400; }
p.adm-sub { margin: 4px 0 14px; font-size: 13.5px; line-height: 19px; }
.adm-mut { color: var(--ad-muted); }
.adm-nota { margin: 8px 0 0; color: var(--ad-muted); font-size: 12.5px; line-height: 18px; }
.adm-vacio { margin: 8px 0 4px; color: var(--ad-muted); }
.adm-aviso { margin: 0 0 12px; padding: 12px 14px; border-radius: 8px; background: #FFF6E5; border: 1px solid #F0D49A; color: #7A4E08; font-size: 13.5px; line-height: 20px; }
.adm-card-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.adm-card-cab > .perfil__h, .adm-card-cab > .adm-h2 { margin: 0 !important; }

/* ---------- tarjetas, tablas y controles ---------- */
.adm-nuevo .admin__card { background: var(--ad-surface); border: 1px solid var(--ad-border); border-radius: 10px; padding: 20px 24px; box-shadow: none; min-width: 0; }
.adm-nuevo .admin__card > .perfil__h, .adm-card-cab > .perfil__h { font: 600 18px/26px "Inter", Arial, sans-serif; color: var(--ad-text); margin: 0 0 4px; }
.adm-pg-solo > .admin__card > h3.perfil__h { display: none; }
.adm-nuevo .admin-count { color: var(--ad-muted); font-weight: 500; }
.adm-ayuda { margin: 0 0 14px; font-size: 13px; color: var(--ad-muted); }
.adm-ayuda > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--ad-accent); font-weight: 500; list-style: none; min-height: 28px; }
.adm-ayuda > summary::-webkit-details-marker { display: none; }
.adm-ayuda > summary::before { content: "i"; display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 50%; font: 700 10px/1 Georgia, serif; }
.adm-ayuda > .admin__hint { margin: 6px 0 0; padding: 10px 12px; background: var(--ad-soft); border-radius: 8px; font-size: 13px; line-height: 19px; color: var(--ad-text); }
.adm-nuevo .admin__tab { font-size: 14px; }
.adm-nuevo .admin__tab thead th { background: var(--ad-page); color: var(--ad-muted); font: 600 11px/16px "Inter", Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.adm-nuevo .admin__tab td { vertical-align: middle; }
.adm-nuevo .admin__tab .num { text-align: right; white-space: nowrap; }
.adm-nuevo .admin__tab tbody tr.is-sel > td { background: #FBF7EF; }
.adm-nuevo .admin__tab tbody tr.is-sel > td:first-child { box-shadow: inset 3px 0 0 var(--ad-accent); }
.adm-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.adm-barra .numin--buscar, .adm-nuevo .admin-cli-head input.numin--buscar, .adm-nuevo #adminPedBuscar { flex: 1 1 260px; max-width: 420px; min-height: 44px; margin: 0; box-sizing: border-box; }
.adm-barra > .adm-btn { margin-left: auto; }
.adm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-nuevo .chip { min-height: 36px; display: inline-flex; align-items: center; gap: 4px; }
.adm-nuevo .chip.is-active { background: var(--ad-accent); border-color: var(--ad-accent); color: #fff; }
.adm-nuevo .chip__n { font-size: 11px; opacity: .8; }
.adm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--ad-accent); border-radius: 6px;
  background: var(--ad-accent); color: #fff; font: 600 14px/20px "Inter", Arial, sans-serif; cursor: pointer; white-space: nowrap; text-decoration: none; }
.adm-btn:hover { background: var(--ad-accent-h); border-color: var(--ad-accent-h); color: #fff; }
.adm-btn .adm-ico { width: 18px; height: 18px; }
.adm-btn--sec { background: var(--ad-surface); color: var(--ad-accent); }
.adm-btn--sec:hover { background: var(--ad-soft); color: var(--ad-accent-h); }
.adm-btn--mini { min-height: 36px; padding: 0 12px; font-size: 13px; }
.adm-enl { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 2px; border: 0; background: none; color: var(--ad-accent); font: 600 13.5px/20px "Inter", Arial, sans-serif; cursor: pointer; white-space: nowrap; text-decoration: none; }
.adm-enl:hover { text-decoration: underline; color: var(--ad-accent-h); }
.adm-enl .adm-ico { width: 16px; height: 16px; }
.adm-enl--peligro { color: var(--ad-alerta); }
.adm-acc { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
/* botón del detalle que pulsa al original de la fila */
.adm-px { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid #D6D0C4; border-radius: 6px; background: #fff;
  color: var(--ad-text); font: 500 13.5px/18px "Inter", Arial, sans-serif; cursor: pointer; white-space: nowrap; }
.adm-px:hover { border-color: var(--ad-accent); color: var(--ad-accent); }
.adm-px[disabled] { opacity: .5; cursor: not-allowed; }
.adm-px--pri { background: var(--ad-accent); border-color: var(--ad-accent); color: #fff; font-weight: 600; }
.adm-px--pri:hover { background: var(--ad-accent-h); color: #fff; }
.adm-px--enl { border-color: transparent; background: none; color: var(--ad-accent); font-weight: 600; }
.adm-px__n { font-size: 11px; color: var(--ad-muted); }
/* estados en pastilla */
.adm-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 10px; border-radius: 999px; font: 600 12px/22px "Inter", Arial, sans-serif; white-space: nowrap; background: #EFEAE1; color: #5B4F3C; }
.adm-badge.is-on, .adm-mu--env, .adm-val--valorada, .adm-sol--aprobada { background: #E3F0E4; color: #1E5B2C; }
.adm-badge.is-pend, .adm-mu--pend, .adm-mu--parcial, .adm-val--por_revisar, .adm-sol--pendiente { background: #F4ECDD; color: #6B4A12; }
.adm-val--en_estudio, .adm-badge.is-nuevo { background: #E6EEF8; color: #1F4E8C; }
.adm-badge.is-off, .adm-mu--nd, .adm-sol--denegada { background: #F8E7E5; color: #8A2A20; }
.adm-val--cerrada { background: #ECECEC; color: #555; }
.adm-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 12px 0 16px; }
.adm-dl > div { min-width: 0; }
.adm-dl dt { font: 600 10.5px/16px "Inter", Arial, sans-serif; letter-spacing: 1px; text-transform: uppercase; color: var(--ad-muted); }
.adm-dl dd { margin: 2px 0 0; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
/* lista + panel lateral de ayuda (detalles de muestras, incidencias, valoraciones y solicitudes) */
.adm-dos { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.adm-dos--igual { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.adm-info { background: #FBFAF7 !important; }
.adm-info > p, .adm-info > h3 { margin: 10px 0 0 !important; font-size: 13.5px; line-height: 20px; color: var(--ad-text); }
.adm-info > h3 { font: 600 13.5px/20px "Inter", Arial, sans-serif !important; }
.adm-info > .adm-btn { margin-top: 16px; width: 100%; }
.adm-mini td, .adm-mini th { padding-top: 10px; padding-bottom: 10px; }

/* ---------- resumen ---------- */
.adm-tjs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.adm-tj { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 18px 20px; border: 1px solid var(--ad-border); border-radius: 10px;
  background: var(--ad-surface); color: var(--ad-text); cursor: pointer; font: 400 14px/20px "Inter", Arial, sans-serif; transition: border-color .15s, background-color .15s; min-width: 0; }
.adm-tj:hover { border-color: var(--ad-accent); background: #FFFDF9; }
.adm-tj__t { font: 600 10.5px/16px "Inter", Arial, sans-serif; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ad-muted); }
.adm-tj__n { font: 600 34px/40px "Inter", Arial, sans-serif; color: var(--ad-text); }
.adm-tj__l { display: inline-flex; align-items: center; gap: 6px; color: var(--ad-accent); font-weight: 600; font-size: 13px; }
.adm-tj__l .adm-ico { width: 15px; height: 15px; }
.adm-nuevo .adm-ult__tab tbody tr { cursor: pointer; }
.adm-nuevo .adm-ult__tab tbody tr:hover > td { background: var(--ad-soft); }
.adm-res-mini p { margin: 6px 0 8px; color: var(--ad-muted); font-size: 14px; }

/* ---------- pedidos: columnas del diseño y el detalle debajo ---------- */
.adm-nuevo #adminPedidos > tr:not(.adm-ped-det) { cursor: pointer; }
.adm-nuevo #adminPedidos > tr:not(.adm-ped-det):hover > td { background: var(--ad-soft); }
.adm-nuevo #adminPedidos > tr.adm-ped-det, .adm-nuevo #adminPedidos .adm-ped-ver { display: none !important; }
.adm-nuevo #adminPedidos > tr > td:first-child { white-space: nowrap; }
.adm-td-pagos .adm-pagos { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.adm-td-pagos .adm-pago-tot { flex-basis: 100%; color: var(--ad-muted); font-size: 12px; }
.adm-td-carga .adm-fecha input { min-height: 36px; max-width: 150px; }
.adm-td-acc { white-space: nowrap; }
.adm-td-acc > * + * { margin-left: 6px; }
/* ★ 19-nov: el pedido elegido, en su propia pantalla: la lista se oculta mientras se ve */
#adminPagePedidos.is-det > .admin__card:not(.adm-pdet) { display: none !important; }
.adm-pdet__barra { display: flex; align-items: center; margin: -4px 0 12px; }
/* ★ 19-nov: lo mismo en Incidencias (el detalle es una rejilla de dos columnas: la barra ocupa las dos) */
#adminPageIncidencias.is-det > .admin__card { display: none !important; }
.adm-incdet__barra { grid-column: 1 / -1; margin: 0; }
.adm-pdet__cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; }
.adm-pdet__cab p.adm-sub { margin-bottom: 0; }
.adm-pdet__acc { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-pdet__lin { margin: 16px 0 0; padding: 0; background: none; }
.adm-pdet__pie { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--ad-border); }
.adm-pdet__tot { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; text-align: right; }
.adm-pdet__tot > span { color: var(--ad-muted); font-size: 13.5px; }
.adm-pdet__tot > span b { color: var(--ad-text); font-weight: 600; }
.adm-pdet__tot > strong { font: 600 20px/28px "Inter", Arial, sans-serif; }
.adm-pdet__tot > small { color: var(--ad-muted); font-size: 12px; }
.adm-arts { margin: 0; background: var(--ad-surface); border: 1px solid var(--ad-border); border-radius: 10px; overflow: hidden; }
.adm-arts__carga { margin: 0; padding: 10px 16px; color: var(--ad-muted); font-size: 13px; border-bottom: 1px solid var(--ad-border); }
.adm-art { font: 400 13px/18px "Inter", Arial, sans-serif; color: var(--ad-text); }
.adm-art + .adm-art { border-top: 1px solid var(--ad-border); }
.adm-art__fila { display: flex; align-items: center; gap: 14px; padding: 12px 16px 4px; }
.adm-art__foto { flex: none; display: grid; place-items: center; width: 84px; height: 64px; padding: 3px; border: 1px solid var(--ad-border); border-radius: 8px; background: #fff; cursor: zoom-in; overflow: hidden; box-sizing: border-box; }
.adm-art__foto img { width: 100%; height: 100%; object-fit: contain; display: block; }
.adm-art__foto[disabled] { cursor: default; background: var(--ad-soft); color: var(--ad-muted); font-size: 10px; line-height: 12px; text-align: center; }
.adm-art__foto:not([disabled]):hover { border-color: var(--ad-accent); }
.adm-art__cab { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.adm-art__nom { font-weight: 600; font-size: 15px; }
.adm-art__sub { color: var(--ad-muted); }
.adm-art__precio { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.adm-art__pvp { font-size: 14px; font-weight: 600; }
.adm-art__cos { color: var(--ad-muted); font-size: 12px; }
.adm-art__valorar { color: var(--ad-accent); font-weight: 600; }
.adm-art__det { padding: 0 16px 10px 114px; }
.adm-art__det > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; list-style: none; color: var(--ad-accent); font-weight: 500; }
.adm-art__det > summary::-webkit-details-marker { display: none; }
.adm-art__det > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.adm-art__det[open] > summary::before { transform: rotate(45deg); }
.adm-art__det > summary small { color: var(--ad-muted); font-weight: 400; }
.adm-art__ocu, .adm-art__det[open] .adm-art__ver { display: none; }
.adm-art__det[open] .adm-art__ocu { display: inline; }
.adm-art__cuerpo { padding: 6px 0 8px; }
.adm-art__conf { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 20px; }
.adm-art__paso h5 { margin: 0 0 4px !important; font: 600 10.5px/16px "Inter", Arial, sans-serif !important; letter-spacing: 1px; text-transform: uppercase; color: var(--ad-accent); }
.adm-art__paso dl { margin: 0; }
.adm-art__paso dl div { display: grid; grid-template-columns: minmax(90px, 42%) minmax(0, 1fr); gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--ad-border); }
.adm-art__paso dt { color: var(--ad-muted); }
.adm-art__paso dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.adm-art__nada { margin: 0; padding: 12px 16px; color: var(--ad-muted); }
.adm-art__cuerpo .adm-art__nada { padding: 0; }
.adm-art__nota { margin: 10px 0 0; padding: 8px 10px; background: var(--ad-soft); border-radius: 8px; white-space: pre-line; overflow-wrap: anywhere; }
.adm-art__arch > b { display: block; margin-bottom: 6px; }
.adm-arch { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.adm-arch__it { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 6px 4px 10px; background: #fff; border: 1px solid var(--ad-border); border-radius: 8px; white-space: normal; }
.adm-arch__ico { flex: none; color: var(--ad-accent); display: grid; }
.adm-arch__n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.adm-arch__b { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 36px; padding: 0 12px; border: 1px solid var(--ad-border); border-radius: 6px; background: #fff; color: var(--ad-text); font: 500 13px/18px "Inter", Arial, sans-serif; cursor: pointer; }
.adm-arch__b .adm-ico { width: 17px; height: 17px; }
.adm-arch__ver { border-color: var(--ad-accent); color: var(--ad-accent); }
.adm-arch__b:hover { background: var(--ad-soft); }
.adm-arch__dl { padding: 0; width: 40px; }
.adm-arch__sin { flex: none; color: var(--ad-muted); }
.adm-arch__ver--suelto { height: 28px; padding: 0 8px; margin: 0 4px; vertical-align: middle; }
/* visor de archivos e imagen en grande */
.adm-visor { width: min(1100px, 96vw); height: min(860px, 92dvh); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #2B2A27; color: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.adm-visor[open] { display: flex; flex-direction: column; }
.adm-visor::backdrop { background: rgba(25, 24, 22, .7); }
.adm-visor__cab { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; background: #191816; font: 400 14px/20px "Inter", Arial, sans-serif; }
.adm-visor__ico { display: grid; color: #D9C29A; }
.adm-visor__n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.adm-visor__pos { flex: none; color: #BDB7AC; }
.adm-visor__b { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 6px; background: none; color: #fff; font: 500 13px/18px "Inter", Arial, sans-serif; cursor: pointer; }
.adm-visor__b:hover, .adm-visor__x:hover { background: rgba(255, 255, 255, .1); }
.adm-visor__x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: #fff; cursor: pointer; }
.adm-visor__cuerpo { position: relative; flex: 1 1 auto; min-height: 0; display: grid; place-items: center; background: #2B2A27; }
.adm-visor__img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; background: #fff; }
.adm-visor__pdf { width: 100%; height: 100%; border: 0; background: #fff; }
/* ★ 19-nov: vídeo, audio y texto en el visor */
.adm-visor__vid { max-width: 100%; max-height: 100%; display: block; background: #000; }
.adm-visor__aud { width: min(420px, 90%); }
.adm-visor__txt { align-self: stretch; justify-self: stretch; margin: 0; padding: 16px 20px; overflow: auto; background: #fff; color: #1b1915; font: 400 13px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.adm-visor__msg { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; text-align: center; color: #E9E4DA; font: 400 14px/20px "Inter", Arial, sans-serif; }
.adm-visor__msg p { margin: 0; }
.adm-visor__msg > .adm-ico { width: 40px; height: 40px; color: #D9C29A; }
.adm-visor__fl { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: 4px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .9); color: #22211F; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.adm-visor__fl--a { left: 12px; }
.adm-visor__fl--s { right: 12px; }
.adm-zoom { padding: 0; border: 0; border-radius: 12px; background: #fff; max-width: min(1000px, 94vw); max-height: 90dvh; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.adm-zoom::backdrop { background: rgba(25, 24, 22, .6); }
.adm-zoom img { display: block; max-width: min(1000px, 94vw); max-height: 90dvh; object-fit: contain; }
.adm-zoom__x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #22211F; cursor: pointer; }

/* ---------- muestras, incidencias, valoraciones y solicitudes ---------- */
.adm-nuevo #adminMuestras > tr, .adm-nuevo #adminInc > tr[data-id], .adm-nuevo #admVal > tr, .adm-nuevo #admSol > tr { cursor: pointer; }
.adm-nuevo #adminMuestras > tr:hover > td, .adm-nuevo #adminInc > tr[data-id]:hover > td, .adm-nuevo #admVal > tr:hover > td, .adm-nuevo #admSol > tr:hover > td { background: var(--ad-soft); }
.adm-td-lin span { display: block; white-space: nowrap; }
.adm-hilo { margin: 16px 0 0; }
.adm-incdet__bloque { margin: 12px 0 0; font-size: 13.5px; }
.adm-incdet__bloque ul { margin: 4px 0 0; padding-left: 18px; }
.adm-incdet__est { display: flex; align-items: center; gap: 8px; }
.adm-val__desc { margin: 0 0 4px; font-size: 14px; line-height: 21px; white-space: pre-line; overflow-wrap: anywhere; }
.adm-val__prod { margin: 0 0 4px; padding-left: 18px; font-size: 14px; line-height: 22px; }
.adm-val__prod small { color: var(--ad-muted); }
.adm-valform { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.adm-valform label { display: flex; flex-direction: column; gap: 4px; font: 500 12px/16px "Inter", Arial, sans-serif; color: var(--ad-muted); }
.adm-valform label small { font-weight: 400; }
.adm-valform input, .adm-valform select, .adm-valform textarea { min-height: 44px; padding: 8px 12px; border: 1px solid #D6D0C4; border-radius: 6px; background: #fff; font: 400 14px/20px "Inter", Arial, sans-serif; color: var(--ad-text); box-sizing: border-box; width: 100%; }
.adm-valform textarea { resize: vertical; min-height: 88px; }
.adm-valform__msg { margin: 0; font-size: 13px; min-height: 0; }
.adm-valform__msg.is-mal { color: var(--ad-alerta); }
.adm-val__hist { margin: 0; padding-left: 16px; font-size: 12.5px; line-height: 18px; color: var(--ad-muted); }
.adm-info > .adm-eye { margin-top: 18px !important; }
.adm-nuevo #adminAprobar { margin: 0; }
.adm-sol-card #adminSolFiltro { margin-bottom: 16px; }

/* ---------- herramientas ---------- */
.adm-herr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.adm-herr__it { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px; border: 1px solid var(--ad-border); border-radius: 10px; background: var(--ad-surface);
  color: var(--ad-text) !important; text-decoration: none !important; transition: border-color .15s; min-width: 0; }
.adm-herr__it:hover { border-color: var(--ad-accent); }
.adm-herr__t { font: 600 17px/24px "Inter", Arial, sans-serif; }
.adm-herr__d { color: var(--ad-muted); font-size: 13.5px; line-height: 19px; flex: 1 1 auto; }
.adm-herr__ab { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--ad-accent); font-weight: 600; font-size: 13.5px; }
.adm-herr__ab .adm-ico { width: 15px; height: 15px; }

/* ---------- tarifas ---------- */
.adm-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--ad-border); }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tabs > button { flex: none; min-height: 44px; padding: 0 16px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ad-muted); font: 500 14px/20px "Inter", Arial, sans-serif; cursor: pointer; white-space: nowrap; }
.adm-tabs > button:hover { color: var(--ad-text); }
.adm-tabs > button.is-on { color: var(--ad-accent); border-bottom-color: var(--ad-accent); font-weight: 600; }
.adm-nuevo .adm-tarifa-nom { width: 100%; max-width: 320px; box-sizing: border-box; }

/* ---------- clientes ---------- */
.adm-nuevo .admin-cli-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.adm-nuevo #admNuevoCli { margin-left: auto; }
.adm-nuevo #adminClientes > tr:not(.adm-cli-vacio) { cursor: pointer; }
.adm-nuevo #adminClientes > tr:not(.adm-cli-vacio):hover > td { background: var(--ad-soft); }
.adm-nuevo #adminClientes .adm-estado { border-radius: 999px; }
.adm-pag { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 14px; }
.adm-pag__tx { color: var(--ad-muted); font-size: 13px; }
.adm-pag__nav { display: flex; flex-wrap: wrap; gap: 4px; }
.adm-pag__b { min-width: 36px; min-height: 36px; padding: 0 10px; border: 1px solid var(--ad-border); border-radius: 6px; background: #fff; color: var(--ad-text); font: 500 13px/18px "Inter", Arial, sans-serif; cursor: pointer; }
.adm-pag__b:hover:not([disabled]) { border-color: var(--ad-accent); }
.adm-pag__b.is-on { background: var(--ad-accent); border-color: var(--ad-accent); color: #fff; }
.adm-pag__b[disabled] { opacity: .45; cursor: default; }

/* ---------- ficha del cliente: una página con pestañas ---------- */
#adminPageClientes.is-ficha > .admin__card { display: none !important; }
.adm-ficha { display: flex; flex-direction: column; gap: 16px; font-family: "Inter", Arial, sans-serif; }
.adm-ficha__barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.adm-ficha__volver { padding-left: 0; }
.adm-ficha .admin__form { margin: 0; padding: 0; border: 0; background: none; display: block; }
.adm-tabp { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.adm-tabp--dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.adm-bloque { background: #fff; border: 1px solid var(--ad-border); border-radius: 10px; padding: 18px 22px 22px; min-width: 0; }
.adm-bloque__h { margin: 0 0 14px !important; font: 600 16px/22px "Inter", Arial, sans-serif !important; color: var(--ad-text); }
.adm-bloque__nota { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--ad-border); color: var(--ad-muted); font-size: 12.5px; line-height: 18px; }
.adm-ficha .admin__form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 14px 16px; }
.adm-tabp--dos .admin__form-grid { grid-template-columns: minmax(0, 1fr) !important; }
.adm-ficha .admin__form-grid label { font: 500 12px/16px "Inter", Arial, sans-serif; text-transform: none; letter-spacing: 0; color: var(--ad-muted); min-width: 0; }
.adm-ficha .admin__form-grid label.admin__chk { flex-direction: row; align-items: center; gap: 8px; color: var(--ad-text); font-size: 14px; min-height: 40px; }
.adm-ficha .admin__form-grid label.admin__chk input { width: 18px; height: 18px; margin: 0; accent-color: var(--ad-accent); }
.adm-ficha .admin__tar3, .adm-ficha .admin__est, .adm-ficha .admin__pago, .adm-ficha label:has(#acObs), .adm-ficha label:has(#acModalidad), .adm-ficha label:has(#acEstancias) { grid-column: 1 / -1; }
.adm-ficha .ac-tar3-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 4px; }
.adm-ficha .admin__pago-row input { width: 72px; }
.adm-copiadir { margin-top: 12px; padding-left: 0; }
.adm-ficha__pie { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 20px;
  background: #fff; border: 1px solid var(--ad-border); border-radius: 10px; box-shadow: 0 -6px 18px rgba(25, 24, 22, .05); }
.adm-ficha__nota { margin: 0; color: var(--ad-muted); font-size: 12.5px; }
.adm-ficha__acc .admin__form-acc { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.adm-ficha #acCancel[hidden] { display: inline-flex !important; }
.adm-ficha .admin__form-nota { display: none; }
.adm-hist { min-width: 0; }
.adm-ficha label[hidden], #adminForm label[hidden] { display: none !important; }   /* ★ 10-nov: filas del motivo de «Exento de IVA» */

/* ---------- revisión 3D a página completa: sin menú ni cabecera del panel ---------- */
body.admin-completa .adm-side, body.admin-completa .adm-cab, body.admin-completa .adm-top { display: none !important; }
body.admin-completa .adm-lay { display: block; }

/* ---------- tableta y móvil ---------- */
@media (max-width: 1100px) {
  .adm-tjs, .adm-herr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-dos { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .adm-lay { display: block; }
  .adm-side { position: sticky; top: var(--adm-top, 64px); z-index: 30; border-right: 0; border-bottom: 1px solid var(--ad-border); }
  .adm-side__in { position: static; max-height: none; overflow: visible; padding: 0; }
  .adm-side__g, .adm-side__pie { display: none !important; }
  .adm-side__nav { flex-direction: row; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 8px 16px; scroll-behavior: smooth; }
  .adm-side__nav::-webkit-scrollbar { display: none; }
  .adm-side__it { flex: none; margin: 0; min-height: 40px; padding: 8px 12px; gap: 8px; white-space: nowrap; }
  .adm-side__it > span { flex: none; }
  .adm-nuevo .admin-wrap { padding: 24px 24px 48px; }
  .adm-top { padding: 0 16px; }
}
@media (max-width: 760px) {   /* las tablas no se aplastan: se desplazan de lado dentro de su recuadro */
  .adm-nuevo .admin__tab--cli { min-width: 780px; }
  .adm-nuevo .admin__tab--ped { min-width: 980px; }
  .adm-nuevo .admin__tab--mu, .adm-nuevo .admin__tab--inc, .adm-nuevo .admin__tab--val, .adm-nuevo .admin__tab--sol { min-width: 760px; }
  .adm-nuevo .admin__tab--mod { min-width: 900px; }
  .adm-nuevo .reg-tabla { min-width: 720px; }
  .adm-tabp--dos { grid-template-columns: minmax(0, 1fr); }
  .adm-art__fila { flex-wrap: wrap; align-items: flex-start; padding: 10px 12px 4px; gap: 10px; }
  .adm-art__foto { width: 64px; height: 52px; }
  .adm-art__cab { flex-basis: calc(100% - 80px); }
  .adm-art__precio { flex-basis: 100%; align-items: flex-start; text-align: left; padding-left: 74px; }
  .adm-art__det { padding: 0 12px 8px; }
  .adm-art__conf { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .adm-top { height: 56px; grid-template-columns: auto 1fr; }
  .adm-top__panel { display: none; }
  .adm-top__btn { max-width: 100%; padding: 0 6px; font-size: 13px; }
  .adm-top__marca b { font-size: 14px; letter-spacing: 2px; }
  .adm-top__marca small { font-size: 8px; letter-spacing: 2px; }
  .adm-nuevo .admin-wrap { padding: 20px 16px 40px; gap: 16px; }
  .adm-cab__tit { font-size: 24px !important; line-height: 30px !important; }
  .adm-tjs, .adm-herr, .adm-dos--igual { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .adm-tj { padding: 14px 16px; }
  .adm-tj__n { font-size: 28px; line-height: 32px; }
  .adm-nuevo .admin__card { padding: 16px; }
  .adm-dl { grid-template-columns: minmax(0, 1fr); }
  .adm-barra .numin--buscar, .adm-nuevo .admin-cli-head input.numin--buscar { flex-basis: 100%; max-width: none; }
  .adm-barra > .adm-btn { margin-left: 0; }
  .adm-nuevo #admNuevoCli { flex: 1 1 100%; margin-left: 0; }
  .adm-pdet__tot { align-items: flex-start; text-align: left; margin-left: 0; }
  .adm-bloque { padding: 14px 14px 16px; }
  .adm-ficha .admin__form-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .adm-ficha__pie { padding: 10px 12px; }
  .adm-ficha__nota { display: none; }
  .adm-ficha__acc, .adm-ficha__acc .admin__form-acc { width: 100%; }
  .adm-ficha__acc .admin__form-acc > * { flex: 1 1 auto; }
  .adm-visor { width: 100vw; height: 100dvh; border-radius: 0; }
  .adm-visor__b span { display: none; }
  .adm-visor__b { padding: 0; width: 44px; justify-content: center; }
  .adm-visor__pos { display: none; }
}

/* ★ t71 (M-10 · Gran batería, pantallas): en PC de poca altura (1366×768, 1280×800, iPad horizontal) el menú lateral del panel no cabía y
   «Cerrar sesión» quedaba debajo, fuera de la vista (el menú ya tenía su propio scroll). Ahora el pie del menú, con «Cerrar sesión», se queda
   pegado abajo y el resto del menú se desplaza por encima. Por debajo de 1024 px el pie no se muestra (tira de apartados): no cambia. */
@media (min-width: 1024px) {
  .adm-side__pie { position: sticky; bottom: 0; z-index: 1; background: var(--ad-surface); }
}

/* ★ t71 (M-8 y M-10 · Gran batería, pantallas): en Pedidos, cuando la tabla no cabe (iPad vertical, PC 1280-1366, panel con menú lateral) la
   columna «Acción» (Confirmar / Ver detalle; es la 8.ª de la cabecera que pinta admin.js: la 9.ª va oculta) quedaba fuera o cortada («Ver d…») y no había pista de que la tabla se desplaza de lado.
   Ahora esa columna se queda fija a la derecha, con fondo opaco y una sombra que avisa de que hay más columnas debajo. Si la tabla cabe, no se nota. */
.adm-nuevo .admin__tab--ped > thead > tr > th:nth-child(8),
.adm-nuevo #adminPedidos > tr:not(.adm-ped-det) > td.adm-td-acc { position: sticky; right: 0; z-index: 1; background: var(--ad-surface); box-shadow: -8px 0 8px -8px rgba(40, 30, 20, .22); }
.adm-nuevo .admin__tab--ped > thead > tr > th:nth-child(8) { background: var(--ad-page); }
.adm-nuevo #adminPedidos > tr:not(.adm-ped-det):hover > td.adm-td-acc { background: var(--ad-soft); }
.adm-nuevo #adminPedidos > tr.is-sel > td.adm-td-acc { background: #FBF7EF; }
