﻿:root {
  /* Estilo Apple sobre tokens de shadcn/ui: azul del sistema, grises iOS, esquinas generosas y sombras suaves */
  --background: #ffffff; --foreground: #1d1d1f;
  --card: #ffffff; --card-foreground: #1d1d1f;
  --primary: #0071e3; --primary-foreground: #ffffff;
  --secondary: #f5f5f7; --secondary-foreground: #1d1d1f;
  --muted: rgba(118, 118, 128, .12); --muted-foreground: #6e6e73;
  --accent: rgba(0, 0, 0, .05); --accent-foreground: #1d1d1f;
  --destructive: #ff3b30; --destructive-foreground: #ffffff;
  --border: rgba(0, 0, 0, .08); --input: rgba(0, 0, 0, .12); --ring: rgba(0, 113, 227, .55);
  --radius: .75rem;
  --bg: #f5f5f7; --panel: var(--card); --gris-1: #f5f5f7; --gris-2: rgba(0, 0, 0, .07); --borde: var(--border); --borde-fuerte: rgba(0, 0, 0, .16);
  --papel: #f5f5f7; --papel-claro: #fbfbfd; --cabecera-tabla: #fbfbfd;
  --grafito: #1d1d1f; --grafito-medio: #6e6e73; --plata: #d2d2d7;
  --texto: var(--foreground); --suave: var(--muted-foreground);
  --azul: #0071e3; --azul-osc: #0058b0; --azul-bg: rgba(0, 113, 227, .1);
  --verde: #34c759; --verde-osc: #248a3d; --verde-bg: rgba(52, 199, 89, .14);
  --rojo: var(--destructive); --rojo-osc: #d70015; --rojo-bg: rgba(255, 59, 48, .1);
  --ambar: #b25000; --ambar-bg: rgba(255, 159, 10, .15);
  --sombra: 0 24px 60px -12px rgba(0, 0, 0, .28), 0 0 0 1px rgba(0, 0, 0, .06);
  --sombra-s: 0 1px 2px rgba(0, 0, 0, .04);
  --sombra-m: 0 8px 28px -8px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .05);
  --sombra-c: 0 1px 3px rgba(0, 0, 0, .05), 0 0 0 1px rgba(0, 0, 0, .05);
  --anillo: 0 0 0 4px rgba(0, 113, 227, .22);
  --radio: calc(var(--radius) + 6px); --radio-s: calc(var(--radius) - 2px);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); }
html, body, button, input, select, textarea { font-family: "Segoe UI Variable Text", "Segoe UI", Tahoma, Arial, sans-serif; }
body { font-size: 14px; line-height: 1.5; color: var(--texto); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; color: var(--texto); letter-spacing: -.025em; }
.flex1 { flex: 1; }
.suave { color: var(--suave); }
.mono { font-variant-numeric: tabular-nums; font-size: 13px; letter-spacing: .01em; }
.ayuda { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--suave); cursor: help; vertical-align: middle; margin-left: 4px; flex: none; font-weight: 400; transition: background .15s, color .15s; }
.ayuda:hover, .ayuda:focus-visible { color: var(--azul); background: var(--azul-bg); outline: none; }
.ayuda .ic { width: 16px; height: 16px; }
#tooltip { position: fixed; z-index: 50; max-width: 360px; background: var(--primary); color: var(--primary-foreground); font-size: 12.5px; line-height: 1.5; padding: 8px 12px; border-radius: 6px; box-shadow: var(--sombra); white-space: pre-line; pointer-events: none; font-weight: 400; text-transform: none; letter-spacing: 0; text-align: left; }
.nw { white-space: nowrap; }
.ic { width: 16px; height: 16px; flex: none; }
* { scrollbar-width: thin; scrollbar-color: var(--borde-fuerte) transparent; }

/* Botones (shadcn/ui Button): .btn = outline, .pri = default, .rojo = destructive, .peq = size sm, .btn-icono = ghost icon */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; border: 1px solid var(--input); background: var(--background); color: var(--foreground); padding: 0 16px; border-radius: var(--radio-s); cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 14px; line-height: 1; text-decoration: none; box-shadow: var(--sombra-s); transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:hover { background: var(--accent); color: var(--accent-foreground); }
.btn:disabled { opacity: .5; cursor: default; pointer-events: none; box-shadow: none; }
.btn.pri { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn.pri:hover { background: rgba(24, 24, 27, .9); border-color: transparent; color: var(--primary-foreground); }
.btn.ok { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn.ok:hover { background: var(--verde-osc); border-color: var(--verde-osc); color: #fff; }
.btn.rojo { background: var(--destructive); border-color: var(--destructive); color: var(--destructive-foreground); }
.btn.rojo:hover { background: rgba(220, 38, 38, .9); border-color: transparent; color: var(--destructive-foreground); }
.btn.rojo-borde { color: var(--destructive); border-color: #fecaca; background: var(--background); }
.btn.rojo-borde:hover { background: var(--rojo-bg); border-color: #fca5a5; color: var(--rojo-osc); }
.btn.ok-borde { color: var(--verde-osc); border-color: #bbf7d0; background: var(--background); }
.btn.ok-borde:hover { background: var(--verde-bg); border-color: #86efac; color: var(--verde-osc); }
.btn.peq { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--radio-s); gap: 6px; }
.btn.peq .ic { width: 14px; height: 14px; }
.btn .ic { width: 16px; height: 16px; }
.btn-icono { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; background: transparent; cursor: pointer; padding: 0; border-radius: var(--radio-s); color: var(--foreground); transition: background .15s; }
.btn-icono:hover { background: var(--accent); }
.btn-icono.rojo { color: var(--destructive); }
.btn-icono.rojo:hover { background: var(--rojo-bg); }
.btn-icono:disabled { opacity: .35; cursor: default; pointer-events: none; }
.enlace { border: 0; background: none; color: var(--foreground); cursor: pointer; padding: 0; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(9, 9, 11, .3); }
.enlace:hover { text-decoration-color: currentColor; }
/* ID de Remote Utilities: el azul marino de siempre, para distinguirlo del resto */
.enlace[data-acc="rut-conectar"] { color: #1e3a8a; font-weight: 600; text-decoration-color: rgba(30, 58, 138, .35); }
.enlace[data-acc="rut-conectar"]:hover { color: #162d6e; }

/* Formularios */
input, select, textarea { background: transparent; border: 1px solid var(--input); border-radius: var(--radio-s); padding: 0 12px; height: 36px; min-width: 0; color: var(--foreground); font-size: 14px; box-shadow: var(--sombra-s); transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; min-height: 64px; padding: 8px 12px; }
input::placeholder, textarea::placeholder { color: var(--muted-foreground); }
input:focus-visible, select:focus-visible, textarea:focus-visible, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ring); box-shadow: var(--anillo); }
.btn:focus-visible, .enlace:focus-visible, .btn-icono:focus-visible, .pestanas button:focus-visible, .segmento button:focus-visible, .subpestanas button:focus-visible { outline: none; box-shadow: var(--anillo); }
input:disabled, select:disabled, textarea:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
textarea { resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; box-shadow: none; padding: 0; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }

label.campo, div.campo { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--texto); }
label.campo > span, div.campo > span { font-weight: 500; line-height: 1; }
label.campo small { font-weight: 400; color: var(--suave); }
.en-linea { display: inline-flex; align-items: center; gap: 8px; }
.rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.completo { grid-column: 1 / -1; }
.buscador { position: relative; }
.buscador .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--suave); pointer-events: none; }
.buscador input { padding-left: 36px; width: 260px; max-width: 100%; border-radius: 999px; }
select.idioma { height: 32px; padding: 0 10px; font-size: 13px; font-weight: 600; border-radius: 999px; }

/* Acceso: pantalla dividida (formulario a la izquierda, panel con arte y fondo animado a la derecha) */
#acceso { position: relative; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: #fff; }
#acceso > .idioma { position: absolute; top: 20px; right: 24px; z-index: 6; }
.acceso-izq { display: flex; flex-direction: column; min-width: 0; padding: 36px clamp(28px, 7vw, 120px); }
.acceso-logo { width: 190px; max-width: 60%; height: auto; display: block; }
.tarjeta-acceso { width: 100%; max-width: 560px; margin: auto 0; padding: 28px 0; }
.tarjeta-acceso h1 { font-size: clamp(34px, 3.8vw, 54px); font-weight: 300; letter-spacing: -.03em; line-height: 1.08; margin: 0 0 14px; }
.acc-sub { color: var(--suave); font-size: 17px; margin: 0 0 34px; }
.tarjeta-acceso p { color: var(--suave); margin: 0 0 16px; }
.tarjeta-acceso form { display: grid; gap: 20px; }
.tarjeta-acceso label.campo { gap: 8px; }
.tarjeta-acceso label.campo > span { font-size: 14px; font-weight: 500; color: var(--texto); }
.tarjeta-acceso input:not([type=checkbox]) { width: 100%; height: auto; background: #f1f1f1; border: 1px solid transparent; border-radius: 14px; padding: 16px 18px; font-size: 15.5px; box-shadow: none; }
.tarjeta-acceso input:not([type=checkbox]):hover { background: #ececec; border-color: transparent; }
.tarjeta-acceso input:not([type=checkbox]):focus { background: #fff; border-color: var(--grafito-medio); box-shadow: 0 0 0 4px rgba(55, 63, 66, .1); }
.campo-pw { position: relative; }
.campo-pw input { padding-right: 54px !important; }
.ver-pw { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; border: 0; background: none; padding: 9px; border-radius: 10px; color: var(--suave); cursor: pointer; }
.ver-pw:hover { color: var(--texto); background: rgba(0, 0, 0, .05); }
.ver-pw .ic { width: 20px; height: 20px; }
.fila-extra { display: flex; justify-content: flex-end; margin-top: -10px; font-size: 14px; }
.fila-extra .enlace { color: var(--azul); }
.tarjeta-acceso .btn.pri { height: auto; background: #111; border-color: #111; color: #fff; border-radius: 14px; padding: 17px; font-size: 16px; font-weight: 600; margin-top: 0; box-shadow: none; }
.tarjeta-acceso .btn.pri:hover:not(:disabled) { background: #2b2b2b; border-color: #2b2b2b; }
.btn.ms-login { height: auto; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 15px; background: #fff; border: 1px solid var(--borde-fuerte); border-radius: 14px; color: var(--texto); font-size: 16px; font-weight: 600; text-decoration: none; margin-top: 0; }
.btn.ms-login:hover { background: var(--gris-1); }
.btn.ms-login .ic { width: 22px; height: 22px; }
.sep-o { display: flex; align-items: center; gap: 14px; margin: 2px 0; color: var(--suave); font-size: 14px; }
.sep-o::before, .sep-o::after { content: ''; flex: 1; height: 1px; background: var(--borde); }
.acc-pie { text-align: center; color: var(--suave); font-size: 14px; margin: 30px 0 0 !important; }
.acceso-der { position: relative; margin: 32px 32px 32px 0; border-radius: 30px; overflow: hidden; isolation: isolate; min-height: 420px; background: #0f1b3d url(/static/img/panel-acceso.svg) center / cover no-repeat; }
#fondo-vivo { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.acceso-vidrio { position: absolute; left: 7%; right: 7%; bottom: 6%; z-index: 2; padding: 22px 24px 24px; color: #fff; border-radius: 22px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.acceso-vidrio h2 { font-size: 20px; font-weight: 600; color: #fff; margin: 0 0 14px; letter-spacing: -.01em; }
.acceso-vidrio ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; color: rgba(255, 255, 255, .92); }
.acceso-vidrio li { display: flex; align-items: flex-start; gap: 10px; }
.acceso-vidrio li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 7px; background: #fff; }
#fondo-selector { position: absolute; left: 16px; bottom: 16px; z-index: 7; display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(255, 255, 255, .92); border: 1px solid var(--borde); border-radius: var(--radio-s); font-size: 12.5px; color: var(--suave); box-shadow: var(--sombra-s); }
#fondo-selector select { padding: 4px 8px; font-size: 12.5px; box-shadow: none; }
@media (max-width: 900px) {
  #acceso { grid-template-columns: 1fr; }
  .acceso-der { display: none; }
  .acceso-izq { padding: 28px 24px 72px; }
}
/* Error de acceso: aviso centrado en toda la ventana, sin panel */
#acceso.modo-error { display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: #f3f3f1; }
#acceso.modo-error .acceso-der, #acceso.modo-error .acceso-logo, #acceso.modo-error > .idioma, #acceso.modo-error #fondo-selector { display: none; }
#acceso.modo-error .acceso-izq { width: 100%; align-items: center; justify-content: center; padding: 0; }
#acceso.modo-error .tarjeta-acceso { max-width: 600px; margin: 0; text-align: center; padding: 40px 44px 32px; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra-m); }
#acceso.modo-error .tarjeta-acceso h1 { font-size: 64px; font-weight: 700; letter-spacing: .14em; color: var(--rojo); margin-bottom: 14px; }
#acceso.modo-error .tarjeta-acceso p { font-size: 17px; color: var(--texto); }
#acceso.modo-error .tarjeta-acceso .enlace { margin-top: 8px; }
.error-acceso { background: var(--rojo-bg); color: var(--rojo-osc); border: 1px solid #f5c2c2; border-radius: var(--radio-s); padding: 9px 12px; font-size: 13px; font-weight: 500; }
.ok-acceso { background: var(--verde-bg); color: #0f5a2a; border: 1px solid #a9d8b8; border-radius: var(--radio-s); padding: 9px 12px; font-size: 13px; font-weight: 500; }
.pie-acceso { font-size: 12.5px; color: var(--suave); text-align: center; margin: 4px 0 0 !important; }
.logo { width: 38px; height: 38px; border-radius: 10px; background: var(--azul); display: grid; place-items: center; flex: none; }
.logo-img { height: 38px; width: auto; max-width: 220px; object-fit: contain; flex: none; margin: 2px 12px 2px 0; }  /* mismo ancho (~186 px) y misma altura de barra que el anterior */

/* Estructura */
#app { display: grid; grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: auto 1fr; height: 100vh; overflow: hidden; background: var(--papel); }
#app.sin-lateral { grid-template-columns: minmax(0, 1fr); }
.barra { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 10px 22px; background: rgba(255, 255, 255, .95); -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.marca b { display: block; font-size: 16px; }
.marca span { font-size: 12px; color: var(--suave); }
.barra-admin { display: flex; align-items: center; gap: 4px; }
.btn-hdr-tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; border: 0; background: transparent; color: var(--muted-foreground); padding: 0 12px; border-radius: var(--radio-s); cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
.btn-hdr-tab:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-hdr-tab.activo { background: var(--accent); color: var(--accent-foreground); }
.btn-hdr-tab .ic { width: 16px; height: 16px; }
.btn-hdr-tab .flecha { display: inline-flex; margin-left: -2px; opacity: .65; transition: transform .15s; }
.btn-hdr-tab .flecha .ic { width: 13px; height: 13px; }
.btn-hdr-tab[aria-expanded="true"] { background: var(--accent); color: var(--accent-foreground); }
.btn-hdr-tab[aria-expanded="true"] .flecha { transform: rotate(180deg); }
/* Menú desplegable de la cabecera (Sincronización y Administración) */
.hdr-menu { position: fixed; z-index: 80; min-width: 210px; padding: 4px; background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radio-s); box-shadow: var(--sombra-m); animation: hdr-menu-in .12s ease-out; }
.hdr-menu[hidden] { display: none; }
@keyframes hdr-menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.hdr-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 8px 10px; border: 0; border-radius: calc(var(--radio-s) - 2px); background: transparent; color: var(--foreground); font-size: 14px; font-weight: 400; text-align: left; cursor: pointer; }
.hdr-menu-item:hover, .hdr-menu-item:focus-visible { background: var(--accent); color: var(--accent-foreground); outline: none; }
.hdr-menu-item.activo { background: var(--accent); color: var(--accent-foreground); font-weight: 500; }
.chip-usuario { display: flex; align-items: center; gap: 9px; border: 1px solid var(--input); background: var(--background); border-radius: 999px; padding: 3px 14px 3px 3px; cursor: pointer; box-shadow: var(--sombra-s); transition: background .15s; }
.chip-usuario:hover { background: var(--accent); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--primary-foreground); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.chip-usuario b { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; text-align: left; }
.chip-usuario small { display: block; color: var(--suave); font-size: 11.5px; line-height: 1.2; text-align: left; }
aside { background: var(--papel-claro); border-right: 1px solid var(--border); padding: 20px 12px; overflow-y: auto; }
.lat-tit { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--suave); font-weight: 700; }
.deleg-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: var(--radio-s); cursor: pointer; color: var(--foreground); font-size: 14px; position: relative; transition: background .15s; margin-bottom: 2px; }
.deleg-item:hover { background: var(--accent); }
.deleg-item.activo { background: var(--accent); font-weight: 500; }
.deleg-item .n { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted-foreground); background: transparent; border-radius: 999px; padding: 0 4px; }
.deleg-item.activo .n { background: var(--primary); color: var(--primary-foreground); padding: 1px 8px; }
.deleg-item .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sep { height: 1px; background: var(--borde); margin: 8px 6px; }
main { padding: 26px 30px 48px; min-width: 0; background: var(--papel); overflow-y: auto; }
.cab-main { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-bottom: 20px; }
.cab-main h1 { font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.cab-main p { margin: 6px 0 0; color: var(--suave); font-size: 13px; }
.pestanas { display: flex; gap: 2px; margin-left: auto; background: var(--muted); padding: 3px; border-radius: var(--radio-s); }
.pestanas button { border: 0; background: transparent; height: 30px; padding: 0 14px; border-radius: calc(var(--radio-s) - 2px); cursor: pointer; color: var(--muted-foreground); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.pestanas button:hover { color: var(--foreground); }
.pestanas button.activo { background: var(--background); color: var(--foreground); box-shadow: var(--sombra-s); }
.pag-titulo { font-size: 20px; margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--borde); }
.pag-titulo span { color: var(--suave); font-weight: 500; }
.subpestanas { display: flex; gap: 22px; border-bottom: 1px solid var(--borde); margin-bottom: 22px; }
.subpestanas button { border: 0; background: none; padding: 10px 2px; margin-bottom: -1px; border-bottom: 2px solid transparent; cursor: pointer; color: var(--suave); font-weight: 600; font-size: 14px; transition: color .15s, border-color .15s; }
.subpestanas button:hover { color: var(--texto); }
.subpestanas button.activo { color: var(--azul); border-bottom-color: var(--azul); }
.barra-herr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.sec { font-size: 17px; font-weight: 600; margin: 28px 0 12px; }

/* Filtros */
.segmento { display: inline-flex; gap: 2px; background: var(--muted); padding: 3px; border-radius: var(--radio-s); }
.segmento button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: calc(var(--radio-s) - 2px); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--muted-foreground); font-size: 14px; font-weight: 500; white-space: nowrap; flex: none; transition: background .15s, color .15s, box-shadow .15s; }
.segmento button:hover { color: var(--texto); }
.segmento button.activo { background: var(--background); color: var(--foreground); box-shadow: var(--sombra-s); }
.segmento .n { font-size: 11.5px; font-weight: 500; background: rgba(9, 9, 11, .07); color: var(--foreground); border-radius: 999px; padding: 0 7px; }
.segmento button.activo .n { background: var(--primary); color: var(--primary-foreground); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--input); background: var(--background); border-radius: 999px; padding: 4px 13px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--foreground); box-shadow: var(--sombra-s); transition: background .15s, border-color .15s; }
.chip:hover { background: var(--accent); }
.chip.activo { border-color: var(--primary); background: var(--primary); color: var(--primary-foreground); font-weight: 500; }
.chip .punto { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip .n { font-weight: 700; }
.filtros-spec { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra-s); }
.filtros-spec label.campo { min-width: 150px; }
.filtros-spec select { padding: 7px 10px; }
.filtros-spec select.usado { border-color: var(--azul); background: var(--azul-bg); font-weight: 600; }

/* Tablas */
.tabla-env { background: var(--card); border: 1px solid var(--border); border-radius: var(--radio); overflow: auto; }
table.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted-foreground); background: var(--card); height: 44px; padding: 0 16px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tabla th.ord { cursor: pointer; user-select: none; }
.tabla th.ord:hover { color: var(--foreground); }
.tabla th .flecha { color: var(--foreground); }
.tabla td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr { transition: background .1s; }
.tabla tbody tr:hover td { background: rgba(244, 244, 245, .6); }
.tabla.equipos td { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.tabla.clicable tbody tr { cursor: pointer; }
.tabla.clicable tbody tr:hover td { background: rgba(244, 244, 245, .8); }
.tabla tr.descartado td { color: var(--muted-foreground); }
.cod { display: inline-block; padding: 2px 9px; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; background: var(--background); border: 1px solid var(--border); border-left: 4px solid var(--c); white-space: nowrap; color: var(--foreground); }
/* Insignias (shadcn/ui Badge): .pill = estado, .rol = rol */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gris-2); color: var(--texto); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }  /* la bolita de color del estado */
.pill.activo { background: #d1fae5; color: #065f46; }
.pill.activo::before { background: #22c55e; opacity: 1; }
.pill.sin-asignar { background: #fef3c7; color: #92400e; }
.pill.sin-asignar::before { background: #f59e0b; opacity: 1; }
.pill.descartado { background: #f4f4f5; color: #52525b; }
.pill.descartado::before { background: #a1a1aa; opacity: 1; }
.pill.bloqueado { background: #fee2e2; color: #991b1b; }
.pill.bloqueado::before { background: #ef4444; opacity: 1; }
.rol { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; line-height: 1.4; padding: 2px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--secondary); color: var(--secondary-foreground); }
.rol.superadmin { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.rol.admin { background: var(--background); color: var(--foreground); border-color: var(--input); }
.rol.sin_rol { background: var(--ambar-bg); color: #92400e; border-color: #fde68a; }

.nota-info, .api-nota { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin: 0 0 16px; background: var(--papel-claro); border: 1px solid var(--borde); border-radius: var(--radio-s); color: var(--suave); font-size: 13px; }
.nota-info .ic, .api-nota .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--grafito-medio); }
.api-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.api-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra-s); transition: box-shadow .15s, border-color .15s; }
.api-card:hover { box-shadow: var(--sombra-m); border-color: var(--borde-fuerte); }
.api-card.inactiva { background: var(--papel-claro); }
.api-card.inactiva .api-tit h3, .api-card.inactiva .api-ico { opacity: .6; }
.api-cab { display: flex; align-items: center; gap: 12px; }
.api-ico { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--azul-bg); color: var(--azul); }
.api-ico .ic { width: 20px; height: 20px; }
.api-ico.grande { width: 56px; height: 56px; border-radius: 16px; }
.api-ico.grande .ic { width: 28px; height: 28px; }
.api-tit { flex: 1; min-width: 0; }
.api-tit h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-host { display: block; color: var(--suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.api-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--gris-1); border: 1px solid var(--borde); font-size: 12.5px; color: var(--texto); }
.api-chip .ic { width: 14px; height: 14px; color: var(--grafito-medio); }
.api-ultima { padding: 10px 12px; border-radius: var(--radio-s); background: var(--gris-1); border-left: 3px solid var(--borde-fuerte); font-size: 13px; }
.api-ultima.bien { border-left-color: #22a35a; background: var(--verde-bg); }
.api-ultima.mal { border-left-color: var(--rojo); background: var(--rojo-bg); }
.api-ultima-et { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); margin-bottom: 2px; }
.api-error { color: var(--rojo-osc); margin-top: 2px; word-break: break-word; }
.api-pie { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 14px; margin-top: auto; border-top: 1px solid var(--borde); }
.api-vacio { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 40px 20px; background: var(--papel-claro); border: 1px dashed var(--borde-fuerte); border-radius: var(--radio); }
.api-vacio p { margin: 0; max-width: 520px; color: var(--suave); }
@media (max-width: 480px) { .api-grid { grid-template-columns: 1fr; } }
.vacio { text-align: center; padding: 44px 20px; color: var(--suave); background: #fff; border: 1px dashed var(--borde-fuerte); border-radius: var(--radio); }
.bienvenida { max-width: 520px; margin: 60px auto; text-align: center; background: #fff; border: 1px solid var(--borde); border-radius: 18px; padding: 36px 30px; box-shadow: var(--sombra-m); }
.bienvenida h2 { font-size: 22px; margin-bottom: 8px; }
.bienvenida p { color: var(--suave); margin: 0 0 18px; }
.accion { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; background: var(--gris-2); color: var(--texto); white-space: nowrap; }
.a-alta, .a-reactivacion, .a-inicio-de-sesion, .a-desbloqueo, .a-copia-creada { background: var(--verde-bg); color: #0f5a2a; }
.a-traslado, .a-ajustes-modificados, .a-reinicio { background: var(--azul-bg); color: var(--azul-osc); }
.a-descarte, .a-eliminacion, .a-acceso-fallido, .a-acceso-bloqueado, .a-bloqueo, .a-copia-restaurada { background: var(--rojo-bg); color: var(--rojo-osc); }
.a-cambio-de-estado, .a-cambio-de-contrasena, .a-recuperacion-solicitada { background: var(--ambar-bg); color: #7a3a04; }
.antes { text-decoration: line-through; color: var(--suave); }
.despues { font-weight: 700; }
details summary { cursor: pointer; color: var(--azul); font-weight: 600; }
details div { font-size: 12.5px; margin-top: 2px; }
.roles-ayuda { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.roles-ayuda div { background: var(--gris-1); border: 1px solid var(--borde); border-radius: var(--radio-s); padding: 11px 13px; font-size: 12.5px; }
.roles-ayuda b { display: block; margin-bottom: 4px; font-size: 13px; }
.insignia { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--destructive); color: var(--destructive-foreground); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.bloque { border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); padding: 24px; margin-top: 18px; background: var(--card); color: var(--card-foreground); box-shadow: var(--sombra-s); }
.bloque h2 { font-size: 16px; font-weight: 600; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.bloque > p { margin: 0 0 12px; color: var(--suave); font-size: 13px; }
.bloque ol { margin: 8px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.6; }
.bloque-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.bloque-cab h2 { margin: 0; }
#adm-cuerpo > .bloque:first-child { margin-top: 0; }
.bloque-cuerpo > p { margin: 0 0 12px; color: var(--suave); font-size: 13px; }
.colapsable.cerrado .bloque-cab { margin-bottom: 0; }
.colapsable.cerrado .bloque-cuerpo { display: none; }
.btn-colapsar .ic { transition: transform .2s; }
.colapsable.cerrado .btn-colapsar .ic { transform: rotate(-90deg); }
.token-caja { display: flex; gap: 8px; align-items: center; background: var(--gris-1); border: 1px solid var(--borde); border-radius: var(--radio-s); padding: 8px 10px; word-break: break-all; }
.fila-subred { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 6px; }
.lista-vincular { max-height: 40vh; overflow: auto; border: 1px solid var(--borde); border-radius: var(--radio-s); margin-top: 8px; }
.lista-vincular label { display: flex; gap: 10px; align-items: center; padding: 8px 11px; border-bottom: 1px solid var(--gris-2); cursor: pointer; }
.lista-vincular label:hover { background: var(--azul-bg); }

/* Ajustes del sistema */
.info-rejilla { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.info-tarjeta { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--borde); border-radius: 12px; background: var(--gris-1); min-width: 0; }
.info-tarjeta span { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--suave); }
.info-tarjeta b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.info-tarjeta small { font-size: 12.5px; color: var(--suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grupo-ajustes { border: 0; border-top: 1px solid var(--gris-2); margin: 0; padding: 18px 0 20px; min-width: 0; }
.grupo-ajustes:first-child { border-top: 0; padding-top: 0; }
.grupo-ajustes legend { float: left; width: 100%; padding: 0; margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--suave); }
.grupo-ajustes legend + * { clear: both; }
.marca-reinicio { color: var(--ambar); font-weight: 700; cursor: help; }
.check-campo { justify-content: flex-start; }
.interruptor { position: relative; display: inline-block; width: 42px; height: 24px; margin-top: 7px; }
.interruptor input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.interruptor i { position: absolute; inset: 0; background: var(--borde-fuerte); border-radius: 999px; transition: background .2s; }
.interruptor i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .25); transition: transform .2s; }
.interruptor input:checked + i { background: var(--azul); }
.interruptor input:checked + i::after { transform: translateX(18px); }
.interruptor input:focus-visible + i { box-shadow: var(--anillo); }
.nota-reinicio { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--ambar-bg); color: #7a3a04; border: 1px solid #f3d9a4; border-radius: var(--radio-s); padding: 10px 12px; margin-bottom: 16px; font-weight: 600; font-size: 13px; }
.nota-reinicio span { flex: 1; }
/* Configuración: una fila por grupo (título y descripción a la izquierda, campos a la derecha) */
/* Título del bloque separado de los grupos: más aire y una línea (desaparece al plegar el bloque) */
#blq-config > .bloque-cab { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--borde); }
#blq-config.cerrado > .bloque-cab { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
#blq-config .bloque-cuerpo > .nota-info, #blq-config .bloque-cuerpo > .nota-reinicio { margin-bottom: 20px; }
.cfg-grid { display: flex; flex-direction: column; }
.cfg-card { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px 40px; padding: 26px 0; border-top: 1px solid var(--gris-2); min-width: 0; }
.cfg-card:first-child { border-top: 0; padding-top: 4px; }
.cfg-cab { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.cfg-cab h3 { font-size: 15px; }
.cfg-cab p { margin: 4px 0 0; color: var(--suave); font-size: 12.5px; line-height: 1.5; }
.cfg-ico { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--azul-bg); color: var(--azul); }
.cfg-ico .ic { width: 19px; height: 19px; }
.cfg-campos { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px 20px; max-width: 780px; align-content: start; }
.cfg-campos > .campo { grid-column: span 3; }
.cfg-campos > .campo.completo { grid-column: 1 / -1; }
.cfg-general > .cfg-campos > .campo:not(.completo) { grid-column: span 2; }  /* los tres números de General, en una sola línea */
.cfg-campos .campo.check-campo { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; background: var(--gris-1); border: 1px solid var(--borde); border-radius: var(--radio-s); }
.cfg-campos .check-campo .interruptor { margin-top: 0; flex: none; }
.cfg-campos .campo > span { color: var(--grafito); }
.cfg-campos label.campo:not(.check-campo) > span, .cfg-campos div.campo > span { display: flex; align-items: center; flex-wrap: wrap; column-gap: 4px; min-height: 22px; }
.cfg-guardar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; padding: 12px 16px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra-m); font-size: 12.5px; }
@media (max-width: 900px) {
  .cfg-card { grid-template-columns: 1fr; gap: 16px; padding: 22px 0; }
  .cfg-cab { flex-direction: row; align-items: center; gap: 12px; }
  .cfg-cab p { margin-top: 2px; }
}
@media (max-width: 560px) { .cfg-campos { grid-template-columns: 1fr; } .cfg-campos > .campo, .cfg-general > .cfg-campos > .campo:not(.completo) { grid-column: 1 / -1; } }
.barra-guardar { display: flex; justify-content: flex-end; padding-top: 16px; border-top: 1px solid var(--gris-2); }
.token-caja code { font-size: 12.5px; }
.reiniciando { display: flex; align-items: center; gap: 14px; }
.reiniciando p { margin: 0; color: var(--suave); }
.girando { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--azul-bg); color: var(--azul); flex: none; }
.girando .ic { width: 20px; height: 20px; animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* Modales */
.modal-fondo { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 20; animation: aparece .15s ease-out; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--sombra); animation: entra-modal .18s ease-out; }
.modal header { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--gris-2); }
.modal header h2 { font-size: 18px; flex: 1; }
.modal-cuerpo { padding: 22px; overflow: auto; }
.modal footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--gris-2); background: var(--cabecera-tabla); border-radius: 0 0 18px 18px; justify-content: flex-end; }
.modal h3.sub { font-size: 12px; color: var(--suave); text-transform: uppercase; letter-spacing: .06em; margin: 22px 0 12px; padding-top: 16px; border-top: 1px solid var(--gris-2); }
.meta { font-size: 12.5px; color: var(--suave); margin: 18px 0 0; }
.nota { font-size: 13px; color: var(--foreground); background: var(--background); border: 1px solid var(--border); padding: 12px 16px; border-radius: var(--radio-s); margin: 12px 0 0; }
.fila-campo { display: grid; grid-template-columns: 1.3fr 1fr 1.4fr 1.2fr auto auto auto; gap: 6px; margin-bottom: 6px; align-items: center; }
.fila-campo .oculto { visibility: hidden; }
.cab-campos { display: grid; grid-template-columns: 1.3fr 1fr 1.4fr 1.2fr 96px; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--suave); margin-bottom: 4px; }
.lista-cols { border: 1px solid var(--borde); border-radius: var(--radio-s); max-height: 50vh; overflow: auto; }
.fila-col { display: flex; align-items: center; gap: 10px; padding: 7px 11px; border-bottom: 1px solid var(--gris-2); }
.fila-col:last-child { border-bottom: 0; }
.fila-col label { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.fila-col.apagada label { color: var(--suave); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }

/* Avisos */
#avisos { position: fixed; bottom: 18px; right: 18px; display: grid; gap: 8px; z-index: 30; }
.aviso { background: #111; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--sombra); max-width: 380px; animation: entra .2s ease-out; font-weight: 500; border-left: 4px solid var(--verde); }
.aviso.error { background: var(--rojo); border-left-color: var(--rojo-osc); }
@keyframes entra { from { transform: translateY(8px); opacity: 0; } }
@keyframes aparece { from { opacity: 0; } }
@keyframes entra-modal { from { transform: translateY(10px) scale(.98); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 1280px) { .tabla.equipos .col-ubicacion { display: none; } #app { grid-template-columns: 215px minmax(0, 1fr); } main { padding: 20px 20px 40px; } .roles-ayuda, .info-rejilla { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; height: auto; overflow: visible; }
  main { overflow-y: visible; }
  .barra { padding: 8px 14px; gap: 6px; }
  .logo-img { height: 27px; margin: 1.5px 0; min-width: 0; flex: 0 1 auto; }
  .btn-hdr-tab { padding: 8px 9px; }
  .chip-usuario { padding: 3px; }
  .chip-usuario > span:not(.avatar) { display: none; }
  aside { border-right: 0; border-bottom: 1px solid var(--borde); padding: 10px 12px; }
  .lat-tit { display: none; }
  #lista-deleg { display: flex; gap: 4px; }
  .deleg-item { width: auto; flex: none; margin: 0; }
  .sep { display: none; }
  main { padding: 16px; }
  .pestanas { margin-left: 0; width: 100%; }
  .segmento, #lista-deleg, .pestanas { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .pestanas button { flex: none; }
  .rejilla, .roles-ayuda, .info-rejilla { grid-template-columns: 1fr; }
  .fila-campo { grid-template-columns: 1fr 1fr; }
  .cab-campos { display: none; }
  .marca span, .chip-usuario small, .btn-hdr-tab span.txt { display: none; }
  .buscador, .buscador input { width: 100%; }
}
@media print {
  .barra, .barra::after, aside, .pestanas, .barra-herr, .no-imprimir { display: none !important; }
  #app, main { display: block; background: #fff; }
  .tabla-env { box-shadow: none; }
}

/* ====================================================================
   Capa estilo Apple (macOS / iOS): tipografía del sistema, paneles blancos
   sobre fondo gris claro, controles rellenos sin borde, azul de acento,
   interruptores verdes, hojas modales con desenfoque.
   ==================================================================== */
html, body, button, input, select, textarea { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, Arial, sans-serif; }
body { letter-spacing: -.011em; font-size: 14px; }
h1, h2, h3 { letter-spacing: -.022em; font-weight: 600; }
* { scrollbar-color: rgba(0, 0, 0, .22) transparent; }
::selection { background: rgba(0, 113, 227, .25); }
#tooltip { background: rgba(29, 29, 31, .92); color: #f5f5f7; border-radius: 10px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* Botones: rellenos tintados, sin borde; el principal es azul */
.btn { border: 0; background: rgba(0, 0, 0, .06); color: var(--foreground); border-radius: 10px; height: 34px; padding: 0 16px; font-weight: 500; box-shadow: none; letter-spacing: -.011em; }
.btn:hover { background: rgba(0, 0, 0, .1); color: var(--foreground); }
.btn:active { transform: scale(.98); }
.btn.pri { background: var(--primary); color: #fff; }
.btn.pri:hover { background: #0077ed; color: #fff; border-color: transparent; }
.btn.ok { background: var(--verde); color: #fff; }
.btn.ok:hover { background: #30b350; color: #fff; }
.btn.rojo { background: var(--destructive); color: #fff; }
.btn.rojo:hover { background: #ff453a; color: #fff; border-color: transparent; }
.btn.rojo-borde { background: var(--rojo-bg); color: var(--rojo-osc); border: 0; }
.btn.rojo-borde:hover { background: rgba(255, 59, 48, .18); color: var(--rojo-osc); }
.btn.ok-borde { background: var(--verde-bg); color: var(--verde-osc); border: 0; }
.btn.ok-borde:hover { background: rgba(52, 199, 89, .24); color: var(--verde-osc); }
.btn.peq { height: 30px; padding: 0 13px; border-radius: 9px; }
.btn-icono { border-radius: 9px; color: var(--grafito-medio); }
.btn-icono:hover { background: rgba(0, 0, 0, .07); color: var(--foreground); }
.btn-icono.rojo { color: var(--destructive); }
.btn-icono.rojo:hover { background: var(--rojo-bg); }
.enlace { color: var(--primary); text-decoration: none; font-weight: 500; }
.enlace:hover { text-decoration: underline; text-underline-offset: 3px; }
.enlace[data-acc="rut-conectar"] { color: #1e3a8a; }

/* Campos: relleno gris suave, sin borde; al enfocar se vuelven blancos con el aro azul */
input, select, textarea { background: rgba(118, 118, 128, .09); border: 1px solid transparent; border-radius: 10px; box-shadow: none; height: 36px; }
input:hover, select:hover, textarea:hover { background: rgba(118, 118, 128, .13); }
input:focus, select:focus, textarea:focus, input:focus-visible, select:focus-visible, textarea:focus-visible { background: #fff; border-color: var(--primary); box-shadow: var(--anillo); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; cursor: pointer; }
select:focus { background-color: #fff; }
select.idioma { padding-right: 28px; }
input[type=checkbox] { width: 18px; height: 18px; border-radius: 5px; }
.buscador input { border-radius: 10px; background-color: rgba(118, 118, 128, .12); }
.btn:focus-visible, .enlace:focus-visible, .btn-icono:focus-visible, .pestanas button:focus-visible, .segmento button:focus-visible, .subpestanas button:focus-visible { box-shadow: var(--anillo); }
label.campo > span, div.campo > span { font-weight: 500; font-size: 13px; color: var(--grafito-medio); }

/* Cabecera: vidrio esmerilado */
.barra { background: rgba(251, 251, 253, .8); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid rgba(0, 0, 0, .08); }
.btn-hdr-tab { border-radius: 9px; color: var(--grafito-medio); font-weight: 500; }
.btn-hdr-tab:hover { background: rgba(0, 0, 0, .05); color: var(--foreground); }
.btn-hdr-tab.activo, .btn-hdr-tab[aria-expanded="true"] { background: var(--azul-bg); color: var(--primary); }
.chip-usuario { border: 0; background: rgba(0, 0, 0, .05); box-shadow: none; }
.chip-usuario:hover { background: rgba(0, 0, 0, .09); }
.avatar { background: linear-gradient(160deg, #5ac8fa, #0071e3); color: #fff; }
.hdr-menu { background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); border: 0; border-radius: 14px; padding: 6px; box-shadow: 0 16px 48px -8px rgba(0, 0, 0, .28), 0 0 0 1px rgba(0, 0, 0, .07); }
.hdr-menu-item { border-radius: 8px; padding: 7px 11px; font-size: 14px; }
.hdr-menu-item:hover, .hdr-menu-item:focus-visible { background: var(--primary); color: #fff; }
.hdr-menu-item.activo { background: var(--azul-bg); color: var(--primary); font-weight: 600; }
.hdr-menu-item.activo:hover { background: var(--primary); color: #fff; }

/* Barra lateral: lista de origen de macOS */
aside { background: rgba(236, 236, 241, .6); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-right: 1px solid rgba(0, 0, 0, .07); }
.lat-tit { font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--suave); }
.deleg-item { border-radius: 8px; padding: 7px 10px; margin-bottom: 1px; }
.deleg-item:hover { background: rgba(0, 0, 0, .05); }
.deleg-item.activo { background: var(--primary); color: #fff; font-weight: 500; }
.deleg-item .n { color: var(--suave); }
.deleg-item.activo .n { background: rgba(255, 255, 255, .25); color: #fff; }

/* Contenido: título grande y pestañas segmentadas */
main { background: var(--bg); }
.cab-main h1 { font-size: 32px; font-weight: 700; letter-spacing: -.035em; }
.cab-main p { font-size: 14px; }
.pestanas, .segmento { background: rgba(118, 118, 128, .12); padding: 2px; border-radius: 10px; }
.pestanas button, .segmento button { height: 30px; border-radius: 8px; font-weight: 500; color: var(--foreground); }
.pestanas button:hover, .segmento button:hover { color: var(--foreground); }
.pestanas button.activo, .segmento button.activo { background: #fff; color: var(--foreground); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .06); font-weight: 600; }
.segmento .n { background: rgba(0, 0, 0, .08); }
.segmento button.activo .n { background: var(--azul-bg); color: var(--primary); }
.pag-titulo { font-size: 24px; font-weight: 700; letter-spacing: -.03em; border-bottom: 0; padding-bottom: 0; margin-bottom: 22px; }
.subpestanas button.activo { color: var(--primary); border-bottom-color: var(--primary); }
.sec { font-size: 19px; font-weight: 600; }

/* Filtros */
.chip { border: 0; background: rgba(118, 118, 128, .12); box-shadow: none; border-radius: 999px; }
.chip:hover { background: rgba(118, 118, 128, .2); }
.chip.activo { background: var(--primary); color: #fff; }
.filtros-spec { background: #fff; border: 0; border-radius: 16px; box-shadow: var(--sombra-c); padding: 16px 18px; }
.filtros-spec select.usado { background-color: var(--azul-bg); border-color: transparent; color: var(--primary); font-weight: 600; }

/* Tablas: tarjeta blanca, cabecera discreta, líneas finas */
.tabla-env { border: 0; border-radius: 16px; box-shadow: var(--sombra-c); }
.tabla th { font-size: 12px; font-weight: 600; color: var(--suave); background: rgba(251, 251, 253, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); height: 40px; border-bottom: 1px solid var(--border); }
.tabla td { border-bottom: 1px solid rgba(0, 0, 0, .06); padding: 13px 16px; }
.tabla tbody tr:hover td, .tabla.clicable tbody tr:hover td { background: rgba(0, 113, 227, .045); }
.cod { border: 0; border-left: 4px solid var(--c); background: rgba(0, 0, 0, .04); border-radius: 7px; }
.pill { font-weight: 600; }
.pill.activo { background: rgba(52, 199, 89, .15); color: #1d7a3a; }
.pill.sin-asignar { background: rgba(255, 159, 10, .16); color: #8a4b00; }
.pill.descartado { background: rgba(118, 118, 128, .14); color: #55555a; }
.pill.bloqueado { background: rgba(255, 59, 48, .12); color: #c4251b; }
.pill.activo::before { background: #34c759; } .pill.sin-asignar::before { background: #ff9f0a; } .pill.descartado::before { background: #8e8e93; } .pill.bloqueado::before { background: #ff3b30; }
.rol { border: 0; border-radius: 999px; padding: 2px 11px; background: rgba(118, 118, 128, .14); color: var(--foreground); font-weight: 500; }
.rol.superadmin { background: var(--primary); color: #fff; }
.rol.admin { background: var(--azul-bg); color: var(--primary); }
.rol.sin_rol { background: var(--ambar-bg); color: #8a4b00; border: 0; }

/* Tarjetas y bloques */
.bloque, .api-card, .vacio, .bienvenida { border: 0; border-radius: 18px; box-shadow: var(--sombra-c); background: #fff; }
.bloque { padding: 26px; }
.api-card:hover { box-shadow: var(--sombra-m); }
.api-card.inactiva { background: rgba(255, 255, 255, .6); }
.api-ico, .cfg-ico { border-radius: 10px; background: var(--azul-bg); color: var(--primary); }
.api-chip { border: 0; background: rgba(118, 118, 128, .12); }
.api-ultima { border-left: 0; border-radius: 10px; }
.api-ultima.bien { background: var(--verde-bg); } .api-ultima.mal { background: var(--rojo-bg); }
.api-pie { border-top: 1px solid rgba(0, 0, 0, .07); }
.api-vacio { background: rgba(255, 255, 255, .6); border: 1px dashed rgba(0, 0, 0, .18); border-radius: 18px; }
.vacio { border: 1px dashed rgba(0, 0, 0, .15); box-shadow: none; }
.nota-info, .api-nota { background: rgba(0, 113, 227, .07); border: 0; border-radius: 12px; color: var(--grafito-medio); }
.nota-info .ic, .api-nota .ic { color: var(--primary); }
.nota { background: #f5f5f7; border: 0; border-radius: 12px; }
.nota-reinicio { background: var(--ambar-bg); border: 0; border-radius: 12px; color: #7a3d00; }
.info-tarjeta { border: 0; border-radius: 14px; background: #f5f5f7; }
.info-tarjeta span { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12px; }
.token-caja, .lista-vincular, .lista-cols { background: #f5f5f7; border: 0; border-radius: 12px; }
.lista-vincular label:hover { background: var(--azul-bg); }
.roles-ayuda div { border: 0; background: #f5f5f7; border-radius: 12px; }
.grupo-ajustes legend { text-transform: none; letter-spacing: 0; font-size: 13px; }
.cfg-campos .campo.check-campo { background: #f5f5f7; border: 0; border-radius: 12px; }
.cfg-card { border-top-color: rgba(0, 0, 0, .07); }
.cfg-guardar { border: 0; border-radius: 16px; background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: var(--sombra-m); }
.accion { border-radius: 999px; }
.insignia { background: var(--destructive); }
details summary { color: var(--primary); }

/* Interruptor estilo iOS */
.interruptor { width: 50px; height: 30px; margin-top: 0; }
.interruptor i { background: rgba(120, 120, 128, .32); transition: background .25s; }
.interruptor i::after { top: 2px; left: 2px; width: 26px; height: 26px; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .25s cubic-bezier(.3, 1.3, .5, 1); }
.interruptor input:checked + i { background: var(--verde); }
.interruptor input:checked + i::after { transform: translateX(20px); }
.interruptor input:focus-visible + i { box-shadow: var(--anillo); }

/* Ventanas modales: hojas de macOS */
.modal-fondo { background: rgba(0, 0, 0, .28); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal { border-radius: 22px; background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); box-shadow: var(--sombra); }
.modal header { border-bottom: 1px solid rgba(0, 0, 0, .07); padding: 20px 24px 16px; }
.modal header h2 { font-size: 19px; font-weight: 700; letter-spacing: -.025em; }
.modal-cuerpo { padding: 22px 24px; }
.modal footer { background: transparent; border-top: 1px solid rgba(0, 0, 0, .07); padding: 14px 24px 18px; border-radius: 0 0 22px 22px; }
.modal h3.sub { text-transform: none; letter-spacing: 0; font-size: 13px; border-top-color: rgba(0, 0, 0, .07); }
.fila-col { border-bottom-color: rgba(0, 0, 0, .06); }

/* Avisos: píldora oscura translúcida */
.aviso { background: rgba(29, 29, 31, .92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-radius: 14px; border-left: 0; font-weight: 500; padding: 12px 18px; }
.aviso.error { background: rgba(215, 0, 21, .94); }

/* Acceso: mismo azul del sistema */
.tarjeta-acceso .btn.pri { background: var(--primary); border-color: var(--primary); }
.tarjeta-acceso .btn.pri:hover:not(:disabled) { background: #0077ed; border-color: #0077ed; }
.tarjeta-acceso input:not([type=checkbox]):focus { border-color: var(--primary); box-shadow: var(--anillo); }
.btn.ms-login { background: #fff; border: 1px solid rgba(0, 0, 0, .14); }
.btn.ms-login:hover { background: #f5f5f7; }
.fila-extra .enlace { color: var(--primary); }
#acceso.modo-error .tarjeta-acceso { border: 0; border-radius: 22px; }
#fondo-selector { border: 0; border-radius: 12px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--sombra-m); }

@media print { .tabla-env, .bloque { box-shadow: none; } }
@media (max-width: 900px) { aside { border-right: 0; border-bottom: 1px solid rgba(0, 0, 0, .07); } .deleg-item.activo { background: var(--primary); } }

/* Tablas al estilo shadcn/ui (Table / Data Table): borde fino con esquinas redondeadas, sin sombra,
   cabecera en gris medio, líneas entre filas y fila resaltada al pasar el ratón */
.tabla-env { background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); box-shadow: none; }
.tabla { font-size: 14px; caption-side: bottom; }
.tabla th { height: 40px; padding: 0 16px; font-size: 14px; font-weight: 500; color: var(--muted-foreground); background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid var(--border); text-align: left; }
.tabla th.ord:hover { color: var(--foreground); background: var(--accent); }
.tabla td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover td, .tabla.clicable tbody tr:hover td { background: rgba(118, 118, 128, .07); }
.tabla tr.descartado td { color: var(--muted-foreground); }
.tabla input[type=checkbox] { border-radius: 4px; }

/* Ajustes al estilo shadcn/ui: Card (cabecera + contenido), Form (etiqueta, campo, descripción),
   Switch en fila con borde, Alert para las notas y Separator entre grupos */
.bloque:has(> .bloque-cab) { padding: 0; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); box-shadow: var(--sombra-s); background: var(--card); }
.bloque:has(> .bloque-cab) > .bloque-cab { padding: 22px 24px; margin: 0; }
.bloque:has(> .bloque-cab) > .bloque-cab h2 { font-size: 18px; font-weight: 600; letter-spacing: -.015em; line-height: 1; }
.bloque:has(> .bloque-cab) > .bloque-cuerpo { padding: 0 24px 24px; }
#blq-config > .bloque-cab, #blq-apis > .bloque-cab, #blq-copias > .bloque-cab { margin-bottom: 0; padding-bottom: 22px; border-bottom: 0; }
#blq-config > .bloque-cuerpo { border-top: 1px solid var(--border); padding-top: 4px; }
.colapsable.cerrado .bloque-cab { padding-bottom: 22px; }

.cfg-card { border-top: 1px solid var(--border); padding: 28px 0; gap: 20px 48px; }
.cfg-card:first-child { border-top: 0; padding-top: 24px; }
.cfg-cab { flex-direction: row; align-items: flex-start; gap: 14px; }
.cfg-ico { width: 36px; height: 36px; border-radius: 8px; background: var(--background); border: 1px solid var(--border); color: var(--foreground); box-shadow: var(--sombra-s); }
.cfg-ico .ic { width: 18px; height: 18px; }
.cfg-cab h3 { font-size: 15px; font-weight: 600; line-height: 1.3; }
.cfg-cab p { font-size: 13px; margin-top: 2px; color: var(--muted-foreground); }
.cfg-campos { gap: 20px 20px; }
.cfg-campos .campo > span, .cfg-campos label.campo:not(.check-campo) > span, .cfg-campos div.campo > span { font-size: 14px; font-weight: 500; line-height: 1; color: var(--foreground); }
.bloque input:not([type=checkbox]), .bloque select, .bloque textarea { background-color: var(--background); border: 1px solid var(--input); border-radius: 8px; box-shadow: var(--sombra-s); }
.bloque input:not([type=checkbox]):hover, .bloque select:hover, .bloque textarea:hover { background-color: var(--background); border-color: var(--borde-fuerte); }
.bloque input:not([type=checkbox]):focus, .bloque select:focus, .bloque textarea:focus { background-color: var(--background); border-color: var(--ring); box-shadow: var(--anillo); }
.bloque input:disabled, .bloque select:disabled, .bloque textarea:disabled { background-color: var(--background); opacity: .5; box-shadow: none; }
.cfg-campos .campo.check-campo { padding: 16px; background: var(--background); border: 1px solid var(--border); border-radius: 10px; }
.cfg-campos .check-campo > span:first-child { font-size: 14px; font-weight: 500; color: var(--foreground); }
.token-caja { background: var(--background); border: 1px solid var(--input); border-radius: 8px; padding: 4px 4px 4px 12px; box-shadow: var(--sombra-s); }
.token-caja input:not([type=checkbox]) { border: 0; box-shadow: none; background: transparent; height: 30px; padding: 0; }
.token-caja input:focus { box-shadow: none; }
.token-caja code { color: var(--muted-foreground); }
.cfg-guardar { background: var(--background); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 -8px 16px -8px rgba(0, 0, 0, .08), var(--sombra-s); -webkit-backdrop-filter: none; backdrop-filter: none; padding: 12px 16px; }
.nota-info, .nota-reinicio { background: var(--background); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; color: var(--foreground); font-weight: 400; }
.nota-info .ic { color: var(--foreground); }
.nota-reinicio { border-color: rgba(245, 158, 11, .5); background: rgba(255, 159, 10, .08); color: #7a3d00; font-weight: 500; }
.api-card { border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); box-shadow: var(--sombra-s); }
.api-card:hover { border-color: var(--borde-fuerte); box-shadow: var(--sombra-m); }
.api-ico { border: 1px solid var(--border); background: var(--background); color: var(--foreground); border-radius: 8px; }
.api-chip { background: var(--background); border: 1px solid var(--border); }
.api-vacio { background: var(--background); border-radius: calc(var(--radius) + 2px); }
.info-tarjeta { background: var(--background); border: 1px solid var(--border); border-radius: 10px; }
/* Switch de shadcn: 44 x 24, activo en el color primario */
.interruptor { width: 44px; height: 24px; }
.interruptor i { background: var(--borde-fuerte); }
.interruptor i::after { top: 2px; left: 2px; width: 20px; height: 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.interruptor input:checked + i { background: var(--primary); }
.interruptor input:checked + i::after { transform: translateX(20px); }

/* Botones al estilo shadcn/ui Button: .btn = outline, .pri = default, .rojo = destructive,
   .peq = size sm, .btn-icono = ghost icon; 36 px de alto, esquinas de 8 px, peso medio */
.btn { height: 36px; padding: 0 16px; gap: 8px; border: 1px solid var(--input); border-radius: 8px; background: var(--background); color: var(--foreground); font-size: 14px; font-weight: 500; letter-spacing: 0; box-shadow: var(--sombra-s); }
.btn:hover { background: var(--accent); color: var(--accent-foreground); border-color: var(--input); }
.btn:active { transform: none; }
.btn.pri { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); box-shadow: var(--sombra-s); }
.btn.pri:hover { background: rgba(0, 113, 227, .9); border-color: transparent; color: var(--primary-foreground); }
.btn.ok { background: var(--verde-osc); border-color: var(--verde-osc); color: #fff; }
.btn.ok:hover { background: rgba(36, 138, 61, .9); border-color: transparent; color: #fff; }
.btn.rojo { background: var(--destructive); border-color: var(--destructive); color: var(--destructive-foreground); }
.btn.rojo:hover { background: rgba(255, 59, 48, .9); border-color: transparent; color: var(--destructive-foreground); }
.btn.rojo-borde { background: var(--background); color: var(--rojo-osc); border: 1px solid rgba(255, 59, 48, .35); }
.btn.rojo-borde:hover { background: var(--rojo-bg); color: var(--rojo-osc); border-color: rgba(255, 59, 48, .5); }
.btn.ok-borde { background: var(--background); color: var(--verde-osc); border: 1px solid rgba(52, 199, 89, .5); }
.btn.ok-borde:hover { background: var(--verde-bg); color: var(--verde-osc); border-color: rgba(52, 199, 89, .7); }
.btn.peq { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn:disabled { opacity: .5; box-shadow: none; }
.btn-icono { width: 36px; height: 36px; border-radius: 8px; color: var(--foreground); background: transparent; }
.btn-icono:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-icono.rojo { color: var(--destructive); }
.btn-icono.rojo:hover { background: var(--rojo-bg); }
.btn.ms-login { border: 1px solid var(--input); }
.btn:focus-visible, .btn-icono:focus-visible { outline: none; box-shadow: var(--anillo); }

/* Idioma del login: en el extremo derecho de la columna del formulario, sin tocar el panel de la derecha */
#acceso > .idioma { top: 48px; right: auto; left: calc(52.38% - 108px); }
@media (max-width: 900px) { #acceso > .idioma { top: 20px; left: auto; right: 24px; } }

/* Notificaciones: icono de información a la izquierda de Inventario, con el número de avisos sin ver */
.btn-alertas { position: relative; width: 36px; padding: 0; justify-content: center; }
.btn-alertas .ic { width: 18px; height: 18px; }
.btn-alertas .insignia { position: absolute; top: 2px; right: 0; margin: 0; min-width: 16px; padding: 0 4px; font-size: 10.5px; line-height: 16px; box-shadow: 0 0 0 2px #fbfbfd; }
.alertas-panel { width: 360px; max-width: calc(100vw - 16px); padding: 0; overflow: hidden; }
.alertas-cab { padding: 14px 16px 10px; font-size: 15px; letter-spacing: -.01em; }
.alertas-resumen { margin: 0; padding: 0 16px 10px; font-size: 13px; color: var(--muted-foreground); }
.alertas-lista { max-height: 340px; overflow-y: auto; border-top: 1px solid var(--border); padding: 4px; }
.alerta-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--foreground); text-align: left; cursor: pointer; font-size: 14px; }
.alerta-item:hover, .alerta-item:focus-visible { background: var(--accent); outline: none; }
.alerta-item b { display: block; font-weight: 600; }
.alerta-item small { display: block; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.4; }
.alerta-punto { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--destructive); }
.alertas-pie { display: block; width: 100%; padding: 11px 16px; border-top: 1px solid var(--border); text-align: center; font-size: 13px; }
.alertas-vacio { display: flex; align-items: center; gap: 12px; margin: 0; padding: 4px 16px 18px; color: var(--muted-foreground); font-size: 13.5px; }
.alertas-vacio .ic { width: 22px; height: 22px; color: var(--verde); }
.btn-alertas .ic { width: 20px; height: 20px; stroke-width: 1.8; transform-origin: 50% 8%; }
.btn-alertas.nuevas { color: var(--foreground); }
.btn-alertas.nuevas .ic { animation: campana 1.1s ease-in-out .3s 1; }
.btn-alertas .insignia { top: 1px; right: 1px; min-width: 17px; line-height: 17px; background: #ff3b30; font-weight: 600; }
@keyframes campana { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 75% { transform: rotate(2deg); } }

/* Estado en línea (latido del agente): punto verde = en línea, gris = sin conexión, hueco = equipo sin agente */
.punto-linea { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; vertical-align: middle; flex: none; }
.punto-linea.on { background: #34c759; box-shadow: 0 0 0 3px rgba(52, 199, 89, .22); }
.punto-linea.off { background: #c7c7cc; }
.punto-linea.sin { background: transparent; }
#cuenta .punto-linea { margin: 0 2px 0 0; background: #34c759; box-shadow: 0 0 0 3px rgba(52, 199, 89, .22); }

/* Equipos en dos grupos (en línea arriba, desconectados abajo) con un icono de monitor: verde = en línea, gris = desconectado */
.ico-linea { display: inline-flex; vertical-align: middle; margin-right: 8px; color: #c7c7cc; }
.ico-linea.on { color: #34c759; }
.ico-linea .ic { width: 16px; height: 16px; stroke-width: 2.1; }
.segmento .ico-linea { margin-right: 6px; }
.segmento button.activo .ico-linea.off { color: #8e8e93; }
.tabla .grupo-conexion td { padding: 10px 16px; height: auto; font-size: 13px; font-weight: 600; letter-spacing: -.005em; color: var(--foreground); background: rgba(118, 118, 128, .07); border-bottom: 1px solid var(--border); cursor: default; white-space: nowrap; max-width: none; overflow: visible; }
.tabla tbody tr.grupo-conexion:hover td, .tabla.clicable tbody tr.grupo-conexion:hover td { background: rgba(118, 118, 128, .07); }
.tabla .grupo-conexion.on td { background: rgba(52, 199, 89, .09); }
.tabla .grupo-conexion .n { margin-left: 6px; font-weight: 500; color: var(--muted-foreground); }
.tabla .grupo-conexion .ico-linea { margin-right: 8px; }

/* Grupos dentro de la misma tabla: un título con una línea que se extiende a la derecha (sin fondo ni bloque aparte) */
.tabla .grupo-conexion td, .tabla .grupo-conexion.on td, .tabla tbody tr.grupo-conexion:hover td, .tabla.clicable tbody tr.grupo-conexion:hover td { background: transparent; border-bottom: 0; padding: 14px 16px 4px; }
.grupo-titulo { display: flex; align-items: center; gap: 12px; color: var(--primary); font-size: 13.5px; font-weight: 600; }
.grupo-titulo::after { content: ""; flex: 1; height: 1px; background: rgba(0, 113, 227, .28); }
.grupo-conexion.off .grupo-titulo { color: var(--muted-foreground); }
.grupo-conexion.off .grupo-titulo::after { background: rgba(0, 0, 0, .14); }
.grupo-titulo .n { margin-left: 4px; font-weight: 500; opacity: .75; }
.grupo-conexion.otros .grupo-titulo { color: var(--muted-foreground); }
.grupo-conexion.otros .grupo-titulo::after { background: rgba(0, 0, 0, .14); }

/* Panel de filtros: cabecera con icono y título (se entiende que sirve para filtrar), contador de filtros activos y plegable */
.filtros-spec { display: block; padding: 0; margin-bottom: 14px; overflow: hidden; }
.filtros-cab { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 6px; }
.filtros-toggle { display: inline-flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-start; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--foreground); font-size: 14px; cursor: pointer; text-align: left; }
.filtros-toggle:hover { background: var(--accent); }
.filtros-toggle:focus-visible { outline: none; box-shadow: var(--anillo); }
.filtros-toggle b { font-weight: 600; }
.filtros-toggle .ic { width: 16px; height: 16px; color: var(--muted-foreground); }
.filtros-n { padding: 1px 9px; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); font-size: 12px; font-weight: 600; }
.filtros-flecha { display: inline-flex; margin-left: auto; transition: transform .2s; }
.filtros-spec.plegado .filtros-flecha { transform: rotate(-90deg); }
.filtros-cuerpo { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; padding: 12px 16px 16px; border-top: 1px solid var(--border); }
.filtros-cuerpo[hidden] { display: none; }
.filtros-cuerpo label.campo { min-width: 170px; }
.filtros-n { white-space: nowrap; }
.grupo-conexion.baja .grupo-titulo { color: var(--muted-foreground); }
.grupo-conexion.baja .grupo-titulo::after { background: rgba(0, 0, 0, .14); }
.alerta-fila { display: flex; align-items: center; gap: 6px; padding-right: 6px; }
.alerta-fila .alerta-item { flex: 1; min-width: 0; }
.alerta-silenciar { flex: none; }

/* Ajustes: pestañas fijas (no se pueden cerrar), estilo pestañas de navegador */
.aj-tabs { display: flex; gap: 4px; align-items: flex-end; padding: 4px 24px 0; margin-bottom: 22px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.aj-tab { flex: none; position: relative; min-width: 110px; height: 38px; padding: 0 18px; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; background: transparent; color: var(--muted-foreground); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; margin-bottom: -1px; transition: background .15s, color .15s; }
.aj-tab:hover:not(.activo) { background: var(--muted); color: var(--foreground); }
.aj-tab.activo { background: var(--background); color: var(--foreground); border-color: var(--border); font-weight: 600; }
.aj-tab.activo::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--background); }
.aj-tab:focus-visible { outline: none; box-shadow: var(--anillo); }
#blq-config > .bloque-cuerpo { border-top: 0; padding-top: 0; }
#sis-config .cfg-card { grid-template-columns: 1fr; border-top: 0; padding: 0; }
#sis-config .cfg-campos { max-width: 860px; }
#sis-config .cfg-guardar { margin-top: 20px; }

/* Ajustes: título de la configuración con icono, integrado en la tarjeta */
#blq-config > .bloque-cab { padding-bottom: 14px; }
.cab-config { display: flex; align-items: center; gap: 12px; }
.cab-config .cfg-ico { width: 34px; height: 34px; }
#blq-copias > .bloque-cab { padding-bottom: 14px; }
.cfg-copias > .cfg-campos > .campo:not(.completo) { grid-column: span 3; }
#copias-ajustes .cfg-card { grid-template-columns: 1fr; border-top: 0; padding: 0; }
#copias-ajustes .cfg-campos { max-width: 860px; }
#copias-ajustes .cfg-guardar { margin-top: 20px; }

/* Plegado: las pestañas se ocultan junto con el contenido */
.colapsable.cerrado > .aj-tabs { display: none; }
#blq-config.cerrado > .bloque-cab, #blq-copias.cerrado > .bloque-cab { padding-bottom: 22px; }
