/* ==========================================================================
   soluciones-ui.css — diseño de la zona Soluciones y de su panel de admin.
   Lenguaje de app moderna (barra superior con blur, "posts", botones pastilla,
   campos con etiqueta flotante, navegación lateral en escritorio y pestañas
   abajo en el celular). Claro/oscuro: sigue al sistema y se puede forzar con
   el botón de la barra (html[data-tema]).
   ========================================================================== */

:root {
  --brand: #1cbb9b;
  --brand-btn: #0e8f75;
  --brand-btn-hover: #0b7a63;
  --on-brand: #ffffff;
  --brand-soft: rgba(28, 187, 155, .14);
  --link: #0b7f68;
  --bg: #ffffff;
  --bg-2: #f7f9f9;
  --line: #eff3f4;
  --line-2: #cfd9de;
  --text: #0f1419;
  --muted: #536471;
  --bar: rgba(255, 255, 255, .86);
  --danger: #d4121f;
  --danger-soft: rgba(244, 33, 46, .1);
  --ok: #08794f;
  --ok-soft: rgba(0, 186, 124, .14);
  --warn: #8a5a00;
  --warn-soft: rgba(255, 173, 31, .2);
  --info: #1a6aa8;
  --info-soft: rgba(29, 155, 240, .12);
  --overlay: rgba(91, 112, 131, .4);
  --sombra: 0 8px 30px rgba(0, 0, 0, .16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-tema="light"]) {
    --brand: #2dd1b0;
    --brand-btn: #2dd1b0;
    --brand-btn-hover: #5fe0c5;
    --on-brand: #03140f;
    --brand-soft: rgba(45, 209, 176, .16);
    --link: #4de0c3;
    --bg: #000000;
    --bg-2: #16181c;
    --line: #2f3336;
    --line-2: #3e4348;
    --text: #e7e9ea;
    --muted: #8b949b;
    --bar: rgba(0, 0, 0, .72);
    --danger: #ff6b75;
    --danger-soft: rgba(244, 33, 46, .18);
    --ok: #3ddc97;
    --ok-soft: rgba(0, 186, 124, .18);
    --warn: #ffcf66;
    --warn-soft: rgba(255, 173, 31, .18);
    --info: #6cc0f5;
    --info-soft: rgba(29, 155, 240, .18);
    --sombra: 0 8px 30px rgba(255, 255, 255, .08);
    color-scheme: dark;
  }
}

:root[data-tema="dark"] {
  --brand: #2dd1b0;
  --brand-btn: #2dd1b0;
  --brand-btn-hover: #5fe0c5;
  --on-brand: #03140f;
  --brand-soft: rgba(45, 209, 176, .16);
  --link: #4de0c3;
  --bg: #000000;
  --bg-2: #16181c;
  --line: #2f3336;
  --line-2: #3e4348;
  --text: #e7e9ea;
  --muted: #8b949b;
  --bar: rgba(0, 0, 0, .72);
  --danger: #ff6b75;
  --danger-soft: rgba(244, 33, 46, .18);
  --ok: #3ddc97;
  --ok-soft: rgba(0, 186, 124, .18);
  --warn: #ffcf66;
  --warn-soft: rgba(255, 173, 31, .18);
  --info: #6cc0f5;
  --info-soft: rgba(29, 155, 240, .18);
  --sombra: 0 8px 30px rgba(255, 255, 255, .08);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--link); }
button, input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-sm { width: 18px; height: 18px; }

/* ---------- barra superior ---------- */
.appbar {
  position: sticky; top: 0; z-index: 35;
  display: flex; align-items: center; gap: 6px;
  height: 56px; padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.appbar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--bar); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { display: block; height: 40px; width: auto; }
.brand small { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 2px; padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 9999px; }
.brand-texto { font-weight: 800; font-size: 21px; letter-spacing: -.03em; color: var(--text); white-space: nowrap; }
.brand-texto b { color: var(--brand); font-weight: 800; }
.logo-oscuro { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="light"]) .logo-claro { display: none !important; }
  :root:not([data-tema="light"]) .logo-oscuro { display: block !important; }
}
:root[data-tema="dark"] .logo-claro { display: none !important; }
:root[data-tema="dark"] .logo-oscuro { display: block !important; }
.espacio { flex: 1; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-2); }
.tema-sol { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="light"]) .tema-sol { display: block; }
  :root:not([data-tema="light"]) .tema-luna { display: none; }
}
:root[data-tema="dark"] .tema-sol { display: block; }
:root[data-tema="dark"] .tema-luna { display: none; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--av, var(--brand-btn)); color: #fff;
  font-weight: 800; font-size: 17px; text-transform: uppercase; user-select: none;
}
.avatar-lg { width: 72px; height: 72px; font-size: 30px; }
.avatar-md { width: 48px; height: 48px; font-size: 20px; }

/* ---------- menú desplegable ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: inline-grid; border-radius: 50%; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-lista {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 250px;
  padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sombra);
}
.menu-lista form { margin: 0; }
.menu-lista .menu-cab { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-lista .menu-cab strong { display: block; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  border: 0; border-radius: 10px; background: none; color: var(--text);
  font: 600 15px var(--font); text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover { background: var(--bg-2); }
.menu-item.peligro { color: var(--danger); }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 20px; border: 1px solid transparent; border-radius: 9999px;
  font: 700 15px var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn-primary { background: var(--brand-btn); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-btn-hover); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-outline:hover { background: var(--bg-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-outline-danger { background: transparent; color: var(--danger); border-color: var(--danger-soft); }
.btn-outline-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; color: var(--link); padding: 0 12px; }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-lg { min-height: 50px; font-size: 16px; }
.btn-sm { min-height: 32px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[aria-disabled="true"] { opacity: .5; cursor: default; pointer-events: none; }
.btn.cargando { pointer-events: none; opacity: .75; }
.btn.cargando::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: giro .7s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }

/* ---------- campos con etiqueta flotante ---------- */
.field { position: relative; margin-bottom: 16px; }
.field input, .field select {
  width: 100%; height: 56px; padding: 22px 14px 6px; border: 1px solid var(--line-2); border-radius: 8px;
  background: transparent; color: var(--text); font-size: 16px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.field label {
  position: absolute; left: 15px; top: 17px; color: var(--muted); font-size: 16px; line-height: 1.2;
  pointer-events: none; transition: top .12s, font-size .12s;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field input:-webkit-autofill + label { top: 8px; font-size: 12px; }
.field input:focus + label { color: var(--link); }
.field .ver-clave { position: absolute; right: 6px; top: 8px; }
.field.con-ojo input { padding-right: 52px; }
.opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 2px 0 18px; }
.opcion { position: relative; display: block; cursor: pointer; }
.opcion input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opcion span { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 10px; border: 1px solid var(--line-2); border-radius: 12px; font-weight: 700; text-align: center; line-height: 1.25; }
.opcion input:checked + span { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--brand-soft); color: var(--link); }
.opcion input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.resumen-pago { margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); }
.resumen-pago div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; overflow-wrap: anywhere; }
.resumen-pago div span:first-child { color: var(--muted); }
.resumen-pago .total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 18px; font-weight: 800; }
.field select { -webkit-appearance: none; appearance: none; padding-right: 44px; }
.field.con-select::after { content: ""; position: absolute; right: 20px; top: 24px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.field select + label, .field.flotante label { top: 8px; font-size: 12px; }
.check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 6px 0; margin: 0 0 12px; font-size: 15px; line-height: 1.35; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--brand-btn); }
.field-ayuda { margin: -8px 0 14px; font-size: 13px; color: var(--muted); }
.honeypot { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- avisos ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; line-height: 1.4; word-break: break-word; }
.notice .ic { margin-top: 1px; }
.notice-cuerpo { flex: 1; min-width: 0; }
.notice-ok { background: var(--ok-soft); color: var(--ok); }
.notice-error { background: var(--danger-soft); color: var(--danger); }
.notice-info { background: var(--info-soft); color: var(--info); }
.notice-aviso { background: var(--warn-soft); color: var(--warn); }
.notice .cerrar { margin: -6px -8px 0 0; width: 32px; height: 32px; color: inherit; }
.cred { margin-top: 10px; display: grid; gap: 8px; }
.cred-fila { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 10px; background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.cred-fila span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; min-width: 104px; }
.cred-fila code { flex: 1; min-width: 0; font: 600 15px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; color: var(--text); }

/* ---------- pantallas de acceso (login, registro...) ---------- */
.auth { min-height: calc(100vh - 56px); display: grid; place-items: center; padding: 24px 16px 40px; }
.auth-card { width: 100%; max-width: 440px; }
.auth.auth-sola { min-height: 100vh; } /* pantalla de ingreso sola, sin barra superior */
.auth-card h1 { font-size: 31px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.auth-card .sub { color: var(--muted); margin-bottom: 26px; font-size: 15px; }
.auth-card .ayuda-fila { display: flex; justify-content: flex-end; margin: -6px 0 18px; font-size: 14px; }
.auth-card .pie { margin-top: 22px; text-align: center; color: var(--muted); font-size: 14px; }
.separador { display: flex; align-items: center; gap: 14px; margin: 20px 0; color: var(--muted); font-size: 14px; }
.separador::before, .separador::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hecho { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 12px 0 4px; }
.hecho-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.hecho-ico .ic { width: 30px; height: 30px; stroke-width: 2.6; }
.beneficios { margin: 26px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--muted); font-size: 14px; }
.beneficios li { display: flex; gap: 10px; align-items: center; }
.beneficios .ic { color: var(--brand); width: 18px; height: 18px; }

/* ---------- estructura tipo app: navegación + columna ---------- */
.layout { display: grid; grid-template-columns: 250px minmax(0, 620px); justify-content: center; max-width: 900px; margin: 0 auto; }
.layout.ancho { grid-template-columns: 250px minmax(0, 1fr); max-width: 1100px; }
.rail { position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.rail a, .rail button {
  display: flex; align-items: center; gap: 18px; width: 100%; padding: 12px 16px; border: 0; border-radius: 9999px;
  background: none; color: var(--text); font: 500 19px var(--font); text-decoration: none; cursor: pointer; text-align: left;
}
.rail a:hover, .rail button:hover { background: var(--bg-2); }
.rail .activo { font-weight: 800; }
.rail form { margin: 0; }
.rail .insignia, .tabbar .insignia {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 9999px; background: var(--brand-btn); color: var(--on-brand);
  font: 700 12px/20px var(--font); text-align: center;
}
.col { min-width: 0; min-height: calc(100vh - 56px); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.col-cab {
  position: sticky; top: 56px; z-index: 10; padding: 14px 16px; background: var(--bar);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
  font-size: 20px; font-weight: 800; letter-spacing: -.01em;
}
.col-cuerpo { padding: 16px; }
.col-cuerpo > .notice:first-child { margin-top: 0; }
.seccion-titulo { padding: 16px 16px 0; font-size: 17px; font-weight: 800; }
.tabbar { display: none; }

/* ---------- posts (productos) y filas de lista ---------- */
.post { display: flex; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.post:hover { background: var(--bg-2); }
.post-cuerpo { flex: 1; min-width: 0; }
.post-cab { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.post-nombre { font-weight: 800; font-size: 16px; }
.post-meta { color: var(--muted); font-size: 14px; }
.post-texto { margin: 4px 0 10px; line-height: 1.45; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 9999px; background: var(--brand-soft); color: var(--link); font-size: 13px; font-weight: 700; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-error { background: var(--danger-soft); color: var(--danger); }
.chip-aviso { background: var(--warn-soft); color: var(--warn); }
.chip-gris { background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); }
details.mas { margin: 0 0 12px; }
details.mas > summary { display: inline-block; padding: 12px 0; cursor: pointer; color: var(--link); font-weight: 700; font-size: 14px; list-style: none; }
details.mas > summary::-webkit-details-marker { display: none; }
details.mas[open] > summary { margin-bottom: 6px; }
details.mas p { color: var(--muted); line-height: 1.5; }
.acciones { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.archivo { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

.fila { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.fila:hover { background: var(--bg-2); }
.fila-texto { flex: 1; min-width: 0; }
.fila-texto strong, .fila-texto span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-texto span { color: var(--muted); font-size: 14px; }
.fila-apilada .fila-texto strong, .fila-apilada .fila-texto span { white-space: normal; overflow-wrap: anywhere; }
.fila-acciones { display: flex; align-items: center; gap: 8px; flex: none; }
.vacio { display: grid; justify-items: center; gap: 8px; padding: 44px 16px; text-align: center; color: var(--muted); }
.vacio .ic { width: 34px; height: 34px; }
.buscador { position: relative; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.buscador .ic { position: absolute; left: 30px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.buscador input { width: 100%; height: 40px; padding: 0 16px 0 40px; border: 0; border-radius: 9999px; background: var(--bg-2); color: var(--text); font-size: 16px; }
.buscador input:focus { outline: 2px solid var(--brand); }
.compositor { padding: 16px; border-bottom: 1px solid var(--line); }
.compositor .acciones { margin-top: 4px; }
.perfil { display: flex; align-items: center; gap: 16px; padding: 20px 16px; border-bottom: 1px solid var(--line); }
.perfil h2 { font-size: 20px; font-weight: 800; }

/* ---------- tarjetas de licencias ---------- */

/* ---------- ventanas (diálogos) ---------- */
dialog.dlg { width: min(92vw, 420px); padding: 24px; border: 0; border-radius: 18px; background: var(--bg); color: var(--text); box-shadow: var(--sombra); }
dialog.dlg::backdrop { background: var(--overlay); }
dialog.dlg h3 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
dialog.dlg .dlg-texto { color: var(--muted); margin-bottom: 18px; }
dialog.dlg form { margin: 0; }
.dlg-acc { display: grid; gap: 10px; margin-top: 6px; }

/* ---------- móvil: pestañas abajo, sin navegación lateral ---------- */
@media (max-width: 899px) {
  .layout, .layout.ancho { display: block; max-width: none; }
  .rail { display: none; }
  .col { border: 0; min-height: 0; }
  body.con-pestanas { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding-bottom: env(safe-area-inset-bottom); background: var(--bar);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button {
    position: relative; flex: 1; display: grid; place-items: center; align-content: center; gap: 3px; height: 58px; border: 0; background: none;
    color: var(--muted); font: 600 11px var(--font); text-decoration: none; cursor: pointer;
  }
  .tabbar .activo { color: var(--text); }
  .tabbar form { flex: 1; margin: 0; display: flex; }
  /* filas con botones (solicitudes): en el celular los botones van debajo del texto */
  .fila-apilada { flex-wrap: wrap; }
  .fila-apilada .fila-acciones { flex-basis: 100%; padding-left: 52px; }
  .tabbar .insignia { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; min-width: 18px; font-size: 11px; line-height: 18px; padding: 0 5px; }
  .auth { padding-top: 12px; }
  .btn-sm { min-height: 40px; }
  .icon-btn { width: 44px; height: 44px; }
  .field-ayuda { margin-top: -6px; }
  details.menu[open]::before { content: ""; position: fixed; inset: 0; z-index: 50; background: var(--overlay); }
  .menu-lista {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 60; min-width: 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: 20px 20px 0 0;
  }
  .menu-item { padding: 14px; font-size: 16px; }
  .menu-lista .menu-cab { padding: 10px 14px 12px; }
  dialog.dlg { width: 100%; max-width: none; margin: auto 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; max-height: 92vh; }
  .auth-card h1 { font-size: 27px; }
  .brand small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: .01ms !important; }
}

/* ---------- otras marcas de la familia (el color de marca cambia; todo lo demás es igual) ---------- */
html[data-marca="sarrailhe"] { --brand: #1d9bf0; --brand-btn: #1a7fd4; --brand-btn-hover: #1569b4; --on-brand: #ffffff; --brand-soft: rgba(29, 155, 240, .13); --link: #1570b8; }
@media (prefers-color-scheme: dark) {
  html[data-marca="sarrailhe"]:not([data-tema="light"]) { --brand: #4aaef5; --brand-btn: #4aaef5; --brand-btn-hover: #78c2f8; --on-brand: #051520; --brand-soft: rgba(74, 174, 245, .16); --link: #78c2f8; }
}
html[data-marca="sarrailhe"][data-tema="dark"] { --brand: #4aaef5; --brand-btn: #4aaef5; --brand-btn-hover: #78c2f8; --on-brand: #051520; --brand-soft: rgba(74, 174, 245, .16); --link: #78c2f8; }

/* ---------- licencias: una fila por licencia; cada celda ocupa una o dos líneas ---------- */
body.tabla-ancha .layout.ancho { max-width: 1400px; }
.tl-cab, .tl-fila { display: grid; grid-template-columns: minmax(150px, 1.3fr) 250px minmax(110px, 1fr) 176px 128px 48px; column-gap: 12px; align-items: center; padding: 0 12px; }
.tl-cab { padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tl-fila { min-height: 58px; padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.tl-fila:hover { background: var(--bg-2); }
.tl-fila[hidden] { display: none; }
.tl-detalle { display: contents; }
.c-persona, .c-clave, .c-producto, .c-estado, .c-vence, .c-menu { grid-row: 1; }
.c-persona { grid-column: 1; } .c-clave { grid-column: 2; } .c-producto { grid-column: 3; }
.c-estado { grid-column: 4; } .c-vence { grid-column: 5; } .c-menu { grid-column: 6; justify-self: end; }
.tl-fila [role="cell"] { min-width: 0; }
.tl-fila strong, .tl-fila .sub, .c-persona span, .c-vence span, .c-producto span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.35; }
.tl-fila strong { font-size: 14px; font-weight: 700; }
.tl-fila .sub, .c-persona span, .c-vence span, .c-producto span { font-size: 12px; color: var(--muted); }
.clave-fila { display: flex; align-items: center; gap: 8px; }
.clave-fila .btn { min-height: 0; height: 26px; padding: 0 10px; font-size: 12px; }
.clave-fila code { flex: none; font: 600 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.c-estado .chips { margin: 0; gap: 4px; }
.c-estado .chip { padding: 1px 8px; font-size: 11px; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 1279px) { /* sin lugar para 6 columnas: cada licencia pasa a dos líneas */
  .tl-cab { display: none; }
  .tl-fila { grid-template-columns: minmax(0, 1fr) auto 40px; grid-template-rows: auto auto; row-gap: 2px; padding-top: 10px; padding-bottom: 10px; }
  .c-persona { grid-column: 1; grid-row: 1; } .c-estado { grid-column: 2; grid-row: 1; } .c-menu { grid-column: 3; grid-row: 1 / span 2; }
  .tl-detalle { display: flex; grid-column: 1 / 3; grid-row: 2; gap: 10px; align-items: baseline; min-width: 0; }
  .c-clave { flex: none; } .c-vence { flex: none; } .c-producto { flex: 1 1 0; }
  .c-persona span, .c-clave .sub, .c-clave .btn, .c-vence span, .c-producto span, .c-vence.sin-vence { display: none; }
  .tl-detalle strong { font-weight: 400; font-size: 12.5px; color: var(--muted); }
  .c-estado .chips { flex-wrap: nowrap; }
  .chip-defecto { display: none; } /* en pantallas angostas solo se marca lo que se sale de lo normal */
}

/* ---------- ABM de alquileres (Resweb) ---------- */
.abm-titulo { font-size: 18px; font-weight: 800; margin: 22px 0 12px; }
.abm-titulo:first-child { margin-top: 4px; }
.abm-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); column-gap: 14px; }
.abm-form .abm-acciones { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.abm-metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.abm-metrica { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.abm-metrica h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.abm-metrica div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 15px; }
.abm-metrica div span { color: var(--muted); }
.abm-metrica .balance { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 7px; font-size: 17px; }
.abm-metrica .balance.neg b { color: var(--danger); }
.abm-tabla { overflow-x: auto; margin: 0 -4px 12px; }
.abm-tabla table { width: 100%; border-collapse: collapse; font-size: 14px; }
.abm-tabla th { padding: 9px 10px; text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.abm-tabla td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.abm-tabla .der { text-align: right; white-space: nowrap; }
.abm-tabla .acc { white-space: nowrap; text-align: right; }
.abm-tabla tbody tr:hover td { background: var(--bg-2); }
form.en-linea { display: inline; }
.abm-borrar { color: var(--danger); }
.abm-mes { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.abm-calendario { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; }
.abm-calendario .dia { border: 1px solid var(--line); border-radius: 8px; min-height: 104px; padding: 5px; overflow-wrap: anywhere; font-size: 13px; }
.abm-calendario .dia.nombre { min-height: 0; text-align: center; font-weight: 800; font-size: 12px; background: var(--bg-2); }
.abm-calendario .dia.vacio-dia { border-color: transparent; }
.abm-calendario .evento { margin-top: 4px; padding: 4px 5px; border-radius: 5px; font-size: 11px; line-height: 1.3; }
.abm-calendario .evento.p0, .abm-prop.p0 { background: rgba(36, 91, 136, .16); }
.abm-calendario .evento.p1, .abm-prop.p1 { background: rgba(255, 150, 40, .24); }
.abm-calendario .evento.p2, .abm-prop.p2 { background: rgba(60, 170, 110, .22); }
.abm-calendario .evento.p3, .abm-prop.p3 { background: rgba(170, 90, 200, .20); }
.abm-calendario .evento.p4, .abm-prop.p4 { background: rgba(220, 70, 90, .18); }
.abm-calendario .evento.p5, .abm-prop.p5 { background: rgba(210, 180, 30, .26); }
.abm-calendario .evento.p-otra { background: var(--bg-2); border: 1px dashed var(--line-2); }
.abm-props, .abm-leyenda { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.abm-prop { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 14px; font-weight: 600; }
.abm-leyenda .abm-prop { padding: 4px 12px; }
.abm-prop .icon-btn { width: 24px; height: 24px; }
.abm-agregar { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.abm-agregar .field { flex: 1 1 220px; margin-bottom: 0; }
@media (max-width: 650px) { .abm-calendario .dia { min-height: 80px; padding: 3px; } .abm-calendario .evento { font-size: 9.5px; padding: 3px; } }
