/* Piezas propias del acortador sobre tokens.css + theme.css (sin hex nuevos: todo sale de tokens) */
:root, .dark { --font-open-sans: "Open Sans"; --font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
.main { padding-top: 0; }
.page > * + * { margin-top: 0; }

/* Marca del lateral */
.marca { display: flex; flex-direction: column; padding: 6px 12px 18px; }
.marca-ws { color: var(--side-title); font-weight: 700; font-size: 16px; }
.marca-app { color: var(--teal); font-weight: 600; font-size: 13px; }
.side-sec { color: var(--side-muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 14px 12px 6px; }
.usuario { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.usuario-txt { display: flex; flex-direction: column; min-width: 0; }
.usuario-txt b { color: var(--side-title); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.usuario-txt small { color: var(--side-muted); font-size: 12px; }
.avatar-ini { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--side-active-bg); color: var(--side-active-text); font-weight: 700; flex: none; }
.nav-item.salir { width: 100%; border: 0; background: transparent; text-align: left; }
.crumbs a { display: inline-flex; color: var(--muted); }
.crumbs a:hover { color: var(--navy); }
.topbar .search input { width: 200px; }

/* Avisos */
.aviso { margin: 14px 0 0; padding: 12px 16px; border-radius: var(--r-card); border: 1px solid var(--tile-line); background: var(--bg); font-weight: 500; }
.aviso.ok { background: var(--tag-green); color: var(--tag-green-t); border-color: transparent; }
.aviso.bad { background: var(--tag-red); color: var(--tag-red-t); border-color: transparent; }
.oculto { display: none; }

/* Formularios */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.campo > span { font-weight: 600; color: var(--navy); font-size: 13px; }
.campo small { color: var(--subtle); font-weight: 400; }
.campo input:not([type=color]):not([type=radio]):not([type=checkbox]), .campo select, select.filtro {
  height: 40px; padding: 0 12px; border: 1px solid var(--tile-line); border-radius: var(--r-ctl); background: var(--bg); color: var(--text); min-width: 0; }
.campo input:focus, .campo select:focus, select.filtro:focus { outline: none; border-color: var(--teal); }
.campo input[type=color] { width: 100%; height: 40px; padding: 3px; border: 1px solid var(--tile-line); border-radius: var(--r-ctl); background: var(--bg); cursor: pointer; }
.campo.ancho { width: 100%; }
.fila-campos { display: flex; gap: 16px; flex-wrap: wrap; }
.fila-campos > .campo { flex: 1 1 220px; }
.fila-campos.tres > .campo { flex-basis: 160px; }
.casilla { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.nota { color: var(--subtle); font-size: 13px; }
.form-crear { gap: 18px; max-width: 860px; }
.form-crear .acciones { display: flex; align-items: center; gap: 14px; }
details.utm summary { cursor: pointer; color: var(--teal); font-weight: 600; }
details.utm[open] summary { margin-bottom: 12px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
legend { font-weight: 600; color: var(--navy); font-size: 13px; margin-bottom: 6px; width: 100%; }
.opcion input { position: absolute; opacity: 0; pointer-events: none; }
.opcion span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--tile-line); border-radius: var(--r-ctl); cursor: pointer; color: var(--muted); }
.opcion input:checked + span { background: var(--teal-soft); color: var(--teal); border-color: var(--teal-line); font-weight: 600; }
.opcion input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
code, .copiable { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--fill-paper); padding: 2px 6px; border-radius: 6px; }
.copiable { cursor: pointer; color: var(--teal); }

/* Lista */
.toolbar select.filtro { width: auto; }
.tabla-scroll { overflow-x: auto; }
.db td .sub { color: var(--subtle); font-size: 12.5px; }
.db td.destino { color: var(--muted); max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.db td .tag { margin-right: 4px; }
.db-foot .pager { align-items: center; }

/* Detalle */
.cabecera-enlace { flex-direction: row; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 18px; }
.cab-izq { flex: 1 1 360px; min-width: 0; }
.eyebrow { color: var(--subtle); font-size: 13px; margin-bottom: 4px; }
.url-corta { word-break: break-all; }
.cabecera-enlace .sub { color: var(--muted); margin: 4px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cab-acciones { display: flex; gap: 10px; flex-wrap: wrap; }
.cab-acciones form { display: contents; }
.bento { margin-top: var(--gap); }
.tile.s5 { grid-column: span 5; } .tile.s7 { grid-column: span 7; }
.destino-actual { word-break: break-all; margin: 0 0 8px; font-weight: 600; }
.destino-actual a { color: var(--teal); }
.form-destino { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; align-items: flex-start; }
.aviso-impreso { padding: 10px 12px; border-radius: var(--r-ctl); background: var(--tag-amber); color: var(--tag-amber-t); }
.cifras { display: flex; gap: 32px; margin-bottom: 14px; }
.cifras .k { color: var(--muted); }
.grafica { width: 100%; height: 100px; }
.grafica .barra-clic { fill: var(--navy); }
.grafica .barra-qr { fill: var(--teal); }
.grafica .eje { stroke: var(--line); }
.leyenda { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-top: 8px; }
.punto { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.punto.clic { background: var(--navy); } .punto.qr { background: var(--teal); margin-left: 10px; }
.tile-head .estado-lectura { margin-left: auto; }
.qr-zona { display: flex; gap: 24px; flex-wrap: wrap; }
.qr-vista { flex: 0 0 240px; width: 240px; height: 240px; border: 1px solid var(--tile-line); border-radius: var(--r-card); overflow: hidden; background: #fff; }
.qr-vista svg { width: 100%; height: 100%; display: block; }
.qr-vista.cargando { opacity: .55; }
.qr-editor { flex: 1 1 260px; display: flex; flex-direction: column; gap: 14px; }
.qr-editor .motivo { padding: 10px 12px; border-radius: var(--r-ctl); background: var(--tag-red); color: var(--tag-red-t); }
.qr-editor .motivo.oculto { display: none; }
.qr-editor .btn.primary { align-self: flex-start; }
.descargas { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.descargas.bloqueadas a { opacity: .4; pointer-events: none; }
.rows .row.hist { height: auto; padding: 10px 0; }

/* Login */
body.login { min-height: 100vh; display: grid; place-items: center; }
.login-caja { width: min(400px, calc(100vw - 32px)); }
.login-marca .marca-ws { color: var(--navy); }
.login-tile { gap: 16px; }

@media (max-width: 1100px) { .tile.s5, .tile.s7 { grid-column: span 12; } }
@media (max-width: 760px) {
  .topbar .search { display: none; }
  .qr-vista { flex-basis: 100%; width: 100%; height: auto; aspect-ratio: 1; }
}

/* Semana 3: analíticas y dominios */
.tile.s12 { grid-column: span 12; }
.seg.rango { display: inline-flex; }
.seg.rango a { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.seg.rango a.on { background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.tile-head .seg.rango { margin-left: auto; }
.desgloses { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.desglose h3 { margin: 0 0 10px; font-size: 14px; color: var(--navy); }
.barra-fila { display: grid; grid-template-columns: minmax(80px, 1.2fr) 2fr auto; align-items: center; gap: 10px; min-height: 30px; }
.barra-fila .etq { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-fila .pista { height: 8px; border-radius: 999px; background: var(--fill-paper); overflow: hidden; }
.barra-fila .relleno { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.barra-fila .num, .row .num { font-weight: 600; color: var(--navy); text-align: right; }
.page-head .actions { align-items: center; flex-wrap: wrap; }
.filtros-analitica { display: contents; }
.kpis { margin-bottom: 0; }
.rows a.row { display: flex; align-items: center; gap: 14px; }
.rows a.row:hover { background: var(--hover); }
.row .row-txt { flex: 1; min-width: 0; }
.row .row-txt .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie { margin-top: 14px; }
.db-card + .bento { margin-top: var(--gap); }
form.en-linea { display: flex; gap: 6px; align-items: center; }
form.en-linea input { height: 32px; padding: 0 10px; border: 1px solid var(--tile-line); border-radius: var(--r-ctl); background: var(--bg); min-width: 180px; }
.form-dominio { display: flex; flex-direction: column; gap: 14px; }
.form-dominio .btn { align-self: flex-start; }
.pasos-dns { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.pasos-dns h3 { margin: 0 0 8px; font-size: 15px; color: var(--navy); }
.pasos-dns ol { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.marcas { display: flex; flex-direction: column; }
.marca-item { border-bottom: 1px solid var(--line); padding: 10px 0; display: flex; align-items: center; gap: 10px; }
details.marca-item { display: block; }
.marca-item summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.marca-item summary::-webkit-details-marker { display: none; }
.marca-item summary .nota { margin-left: auto; }
.marca-item.nueva { border-bottom: 0; color: var(--teal); }
.muestra { width: 18px; height: 18px; border-radius: 5px; flex: none; border: 1px solid var(--tile-line); }
.form-marca { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 4px; }
.form-marca .btn { align-self: flex-start; }
.campo.color { flex: 0 0 90px; }

/* Semana 4: tokens de API */
.token-nuevo { margin-bottom: 18px; border-color: var(--teal); }
.token-nuevo h3 { font-size: 14px; color: var(--navy); margin: 16px 0 4px; }
.copia-token { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.copia-token code { font-size: 14px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--tile-line); border-radius: var(--r-ctl); word-break: break-all; }
pre.codigo { background: var(--bg); border: 1px solid var(--tile-line); border-radius: var(--r-ctl); padding: 10px 12px; font-size: 12.5px; overflow-x: auto; white-space: pre; margin: 4px 0 8px; }
.form-token { display: flex; flex-direction: column; gap: 14px; }
.form-token fieldset { flex-direction: column; }
.form-token fieldset .casilla { font-size: 14px; }
.form-token legend { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.lista-ayuda { margin: 0 0 10px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
tr.apagado td { opacity: .55; }

/* Renombrar enlace */
.form-nombre { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 10px; }
.form-nombre > .campo { flex: 1 1 260px; }
.form-nombre > .campo.ancho { width: auto; }
.campo > .con-prefijo { display: flex; align-items: stretch; font-weight: 400; font-size: inherit; color: inherit; }
.con-prefijo .prefijo { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--tile-line); border-right: 0; border-radius: var(--r-ctl) 0 0 var(--r-ctl); background: var(--bg); color: var(--subtle); white-space: nowrap; font-size: 14px; }
.campo .con-prefijo input:not([type=color]):not([type=radio]):not([type=checkbox]) { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; flex: 1; min-width: 0; }

/* Multitenant: selector de cuenta y acciones por fila */
.selector-cuenta { padding: 0 12px 4px; }
.selector-cuenta label { display: block; }
.selector-cuenta .side-sec { padding-left: 0; }
.selector-cuenta select { width: 100%; padding: 7px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: inherit; font: inherit; font-size: 13px; }
.selector-cuenta select option { color: #141d3a; }
.side-light .selector-cuenta select { border-color: var(--border, #dfe5ef); background: #fff; }
.acciones-fila { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
