/* Control de TV · TiNetwork
   Gris neutro claro, un acento (azul TiNetwork) y la trama de puntos de la marca como detalle propio */
:root {
  --bg: #fafafa;
  --card: #ffffff;
  --raised: #f4f4f5;
  --line: rgba(23, 23, 23, .08);
  --line-strong: rgba(23, 23, 23, .14);
  --text: #171717;
  --text-2: #525252;
  --muted: #737373;
  --accent: #0a63eb;
  --accent-ink: #0052c7;
  --accent-soft: #eef4ff;
  --ok: #16a34a;
  --ok-soft: #ecf8f0;
  --warn: #a16207;
  --warn-soft: #fdf6e3;
  --err: #dc2626;
  --err-soft: #fdeeee;
  --r-tag: 6px;
  --r-ctl: 8px;
  --r-card: 12px;
  --r-panel: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, .06);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 400 14px/20px var(--sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: 28px; line-height: 1.15; font-weight: 500; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 18px; line-height: 24px; font-weight: 500; margin: 0; }
h3 { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--text-2); margin: 24px 0 8px; }
h3:first-child { margin-top: 0; }
p { margin: 0; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: 12px; }
code { background: var(--raised); padding: 2px 6px; border-radius: var(--r-tag); color: var(--text-2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }
.error { color: var(--err); min-height: 20px; font-size: 13px; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- controles ---------- */
input, select, textarea {
  font: inherit; color: inherit;
  width: 100%; height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--card);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { height: auto; padding: 8px 12px; resize: vertical; font-family: var(--mono); font-size: 12px; line-height: 20px; }
input::placeholder, textarea::placeholder { color: #a3a3a3; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10, 99, 235, .14); }
input:disabled, select:disabled { background: var(--raised); color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); min-width: 0; }
.field > input, .field > select, .field > textarea, .field > .pw { font-weight: 400; font-size: 14px; color: var(--text); }
.field.end { justify-content: flex-end; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.check.pad { align-self: end; height: 36px; }
.pw { display: flex; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px;
  font: 500 14px/1 var(--sans);
  border-radius: var(--r-ctl);
  border: 1px solid var(--line-strong); background: var(--card); color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease);
}
.btn:hover { background: var(--raised); }
.btn:active { transform: scale(.98); }
.btn:focus-visible, .nav button:focus-visible, .profile-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: rgba(220, 38, 38, .24); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--raised); color: var(--text); }
.btn.ghost.danger { color: var(--err); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 32px; padding: 0; }
.btn.block { width: 100%; }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; font-size: 12px; font-weight: 500; border-radius: var(--r-tag); background: var(--raised); color: var(--text-2); white-space: nowrap; }
.tag .ico { width: 12px; height: 12px; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.err { background: var(--err-soft); color: var(--err); }
.tag.on { background: var(--text); color: #fff; }
.profile-name { font-weight: 500; color: var(--text); white-space: nowrap; }
.meta { font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #d4d4d4; display: inline-block; flex: none; }
.dot.on { background: var(--ok); }

/* ---------- ingreso ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 360px; max-width: 100%; background: var(--card); padding: 32px; border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow-float); display: flex; flex-direction: column; gap: 16px; }
.login-card .brand { margin-bottom: 8px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 20px; width: auto; display: block; }
.brand .name { display: flex; flex-direction: column; line-height: 1.2; }
.brand b { font-size: 16px; font-weight: 600; }
.brand small { font-size: 12px; color: var(--muted); }

.login-step { display: flex; flex-direction: column; gap: 12px; }
.btn.ms { height: 40px; text-decoration: none; color: var(--text); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 8px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code-input { height: 48px; text-align: center; font: 500 24px var(--mono); letter-spacing: .3em; }
.qr { align-self: center; width: 200px; height: 200px; padding: 8px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: #fff; }
.qr svg { width: 100%; height: 100%; display: block; }
.me { display: flex; align-items: center; gap: 4px; padding: 12px 8px 0; border-top: 1px solid var(--line); margin-top: 12px; }
.me .cell-stack { flex: 1; min-width: 0; }
.me .t { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .s { font-size: 12px; color: var(--muted); }
.nav-sep.first { padding-top: 0; }
dialog.modal { border: 0; padding: 0; border-radius: var(--r-panel); box-shadow: var(--shadow-float); width: 640px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); }
dialog.modal[open] { animation: enter-up-m .3s var(--ease); }
@keyframes enter-up-m { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.modal-body h3 { margin: 12px 0 0; }
.perm { font-size: 12px; }
.readonly .needs-operate, .readonly-admin .needs-admin { display: none !important; }

/* ---------- estructura ---------- */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 0 8px; height: 36px; }
.side-company { padding: 0 8px; margin-top: 24px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; margin-top: 24px; }
.nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 8px;
  font: 500 14px/1 var(--sans); color: var(--text-2); text-align: left;
  background: none; border: 0; border-radius: var(--r-ctl); cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.nav button .ico { color: var(--muted); }
.nav button:hover { background: var(--raised); color: var(--text); }
.nav button.active { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.nav button.active .ico { color: var(--accent); }
.nav .count { margin-left: auto; font: 400 12px var(--mono); color: var(--muted); }
.nav .badge { margin-left: auto; font: 500 12px var(--mono); color: #fff; background: var(--accent); border-radius: var(--r-tag); padding: 2px 6px; }
.nav-sep { font-size: 12px; color: var(--muted); padding: 24px 8px 8px; }
.side-logout { justify-content: flex-start; padding: 0 8px; }

.main { padding: 32px; min-width: 0; max-width: 1440px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.view-head p { margin-top: 4px; color: var(--text-2); }
.toolbar { display: flex; gap: 8px; align-items: center; }
.toolbar input, .toolbar select { width: auto; }
.search-box { position: relative; }
.search-box .ico { position: absolute; left: 12px; top: 10px; color: var(--muted); }
.search-box input { padding-left: 36px; width: 240px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 24px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; }
.empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .btn { margin-top: 8px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: end; }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 24px; flex-wrap: wrap; }

/* ---------- indicadores ---------- */
.stats { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.stat span { color: var(--text-2); font-size: 13px; }
.stat b { font-size: 28px; line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat b small { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.stat.lead { flex-direction: row; align-items: center; gap: 20px; }
.stat.lead .tv { width: 72px; }
.stat.lead > div:last-child { display: flex; flex-direction: column; gap: 8px; }
.stat b.bad { color: var(--err); }

/* ---------- tablas ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 0 16px; height: 40px; background: var(--card); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; transition: background-color .15s var(--ease); }
.table tbody tr.click:hover { background: #fcfcfc; }
.table tbody tr.click:hover td:last-child .btn { background: var(--raised); }
.table td.right, .table th.right { text-align: right; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-stack .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-stack .s { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.state { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.state.off { color: var(--muted); }

/* ---------- mini TV (momento): la pantalla que muestra cada equipo ---------- */
.tv { --w: 48px; width: var(--w); flex: none; display: flex; flex-direction: column; align-items: center; }
.tv-frame { width: 100%; aspect-ratio: 16 / 9.4; border-radius: calc(var(--w) * .07); padding: calc(var(--w) * .045); background: linear-gradient(#2b2d31, #18191c); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.tv-screen { position: relative; width: 100%; height: 100%; border-radius: calc(var(--w) * .03); overflow: hidden; background: #0b0c0e; }
.tv-foot { width: 30%; height: calc(var(--w) * .05); margin-top: calc(var(--w) * .02); border-radius: 0 0 4px 4px; background: #c9c9cc; }
/* apagada: la trama de puntos de TiNetwork */
.tv-screen.off::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255, 255, 255, .13) 0 32%, transparent 36%) 0 0 / calc(var(--w) * .07) calc(var(--w) * .07); }
.tv-screen .glare { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255, 255, 255, .08), transparent 45%); pointer-events: none; }
/* encendida: un esquema de la pantalla de inicio */
.tv-screen .ui { position: absolute; inset: 14% 10%; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 1.6fr; gap: 8%; }
.tv-screen .ui i { border-radius: 2px; background: rgba(255, 255, 255, .14); }
.tv-screen .ui i.big { grid-column: span 2; grid-row: span 2; }
.tv-screen.viggo { background: linear-gradient(160deg, #0f3346, #0a1d2a); }
.tv-screen.viggo .ui i.big { background: #2f8fb6; }
.tv-screen.zapping { background: linear-gradient(160deg, #241632, #120c1b); }
.tv-screen.zapping .ui i.big { background: #e8475f; }
.tv-screen.other { background: linear-gradient(160deg, #273041, #151a24); }
.tv-screen.other .ui i.big { background: #6b7a96; }
.tv.big { --w: 100%; }
.tv.big .tv-frame { border-radius: 14px; padding: 10px; }
.tv.big .tv-screen { border-radius: 6px; }
.tv.big .tv-screen.off::before { background-size: 12px 12px; }
.tv.big .tv-foot { height: 10px; margin-top: 4px; width: 24%; }
.tv.big .tv-screen .ui { inset: 12% 10% 32%; gap: 5%; }
.tv.big .tv-screen .ui i { border-radius: 6px; }
.tv-caption { position: absolute; left: 12%; bottom: 8%; color: rgba(255, 255, 255, .86); font-size: 13px; font-weight: 500; }
.tv-caption small { display: block; color: rgba(255, 255, 255, .56); font: 400 12px var(--mono); }

/* ---------- apps del equipo ---------- */
.app-list { display: flex; flex-direction: column; }
.app-row { display: grid; grid-template-columns: minmax(0, 1fr) 136px 80px auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.app-row .ver { max-width: 136px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-row:first-child { border-top: 0; }
.app-row .right { text-align: right; align-items: flex-end; }
.app-row .tag { justify-self: start; }
.app-row .btns { display: flex; gap: 4px; justify-content: flex-end; }

.search-box.wide input { width: 100%; }
.results { margin-top: 12px; }
.results:empty { display: none; }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.result-row:first-child { border-top: 0; }
.result-row .s { white-space: normal; }

/* ---------- pendientes ---------- */
.pending-list { display: flex; flex-direction: column; gap: 16px; }
.pending-item { display: flex; flex-direction: column; gap: 20px; margin: 0; }
.pending-top { display: flex; align-items: center; gap: 16px; }
.approve { display: grid; grid-template-columns: 112px minmax(0, 1.2fr) 88px repeat(3, minmax(0, 1fr)) auto auto; gap: 12px; align-items: end; }
.approve .code input { font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; font-weight: 500; }

/* ---------- perfiles ---------- */
.profiles { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.profile-list { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 32px; }
.profile-item { text-align: left; font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.profile-item:hover { border-color: var(--line-strong); }
.profile-item.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.profile-item .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.profile-item b { font-weight: 500; }
.profile-item small { color: var(--muted); font-size: 13px; }
.profile-editor { margin-bottom: 0; }
.editor-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.title-input { height: 40px; font-size: 20px; font-weight: 500; border-color: transparent; padding: 0 8px; margin-left: -8px; }
.title-input:hover { border-color: var(--line-strong); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.checks label { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); cursor: pointer; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.checks label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.checks input { width: 16px; height: 16px; accent-color: var(--accent); }
.checks .s { color: var(--muted); font: 400 12px var(--mono); }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle > span { width: 36px; height: 20px; border-radius: 10px; background: #d4d4d4; position: relative; flex: none; transition: background-color .15s var(--ease); }
.toggle > span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .18s var(--ease); }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(16px); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle div { display: flex; flex-direction: column; gap: 2px; }
.toggle b { font-weight: 500; }
.toggle small { color: var(--muted); font-size: 13px; }
.sticky { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); margin: 24px -24px -24px; padding: 16px 24px; border-radius: 0 0 var(--r-card) var(--r-card); }

/* ---------- launcher propio: plantillas y vista previa (momento) ---------- */
.launcher-editor { display: flex; flex-direction: column; gap: 16px; }
.templates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tpl input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-card { display: grid; grid-template-columns: 96px 1fr; grid-template-rows: auto auto; gap: 2px 12px; align-items: center; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); cursor: pointer; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.tpl-card .lp-mini { grid-row: span 2; }
.tpl-card b { font-weight: 500; align-self: end; }
.tpl-card small { color: var(--muted); font-size: 13px; align-self: start; }
.tpl input:checked + .tpl-card { border-color: var(--accent); background: var(--accent-soft); }
.tpl input:focus-visible + .tpl-card { outline: 2px solid var(--accent); outline-offset: 2px; }
.lp-mini { display: block; width: 96px; aspect-ratio: 16 / 9; border-radius: 4px; background: #15171c; position: relative; overflow: hidden; }
.lp-mini.hotel { background: linear-gradient(160deg, #24406e, #0b0d12); }
.lp-mini.hotel::before { content: ""; position: absolute; left: 10%; top: 38%; width: 46%; height: 9%; border-radius: 2px; background: rgba(255, 255, 255, .8); }
.lp-mini.hotel::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 12%; height: 20%; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .3) 0 18%, transparent 18% 22%); }
.lp-mini.grid::after { content: ""; position: absolute; inset: 26% 10% 10%; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .26) 0 16%, transparent 16% 21%), #15171c; -webkit-mask: repeating-linear-gradient(180deg, #000 0 26%, transparent 26% 40%); mask: repeating-linear-gradient(180deg, #000 0 26%, transparent 26% 40%); }
.launcher-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.launcher-fields { display: flex; flex-direction: column; gap: 12px; }
.color-row, .media-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 44px; padding: 4px; flex: none; }
.lp { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-ctl); overflow: hidden; background: #0d0f13 center / cover no-repeat; color: #fff; font-family: Roboto, var(--sans); box-shadow: 0 0 0 6px #1b1d22, var(--shadow-float); }
.lp::before { content: ""; position: absolute; inset: 0; }
.lp.hotel::before { background: linear-gradient(rgba(0, 0, 0, .4), rgba(0, 0, 0, .06) 45%, rgba(0, 0, 0, .85)); }
.lp.grid::before { background: rgba(13, 15, 19, .85); }
.lp-in { position: absolute; inset: 5% 5%; display: flex; flex-direction: column; }
.lp-head { display: flex; align-items: center; gap: 8px; }
.lp-head img { height: 18px; max-width: 90px; object-fit: contain; }
.lp-title { flex: 1; font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-clock { text-align: right; font-size: 11px; font-weight: 500; line-height: 1.1; }
.lp-clock small { display: block; font-size: 6px; font-weight: 400; opacity: .7; }
.lp-gear { width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; }
.lp-gear .ico { width: 10px; height: 10px; }
.lp-msg { margin-top: auto; font-size: 20px; line-height: 1.15; font-weight: 400; margin-bottom: 6px; max-width: 80%; }
.lp-cap { font-size: 7px; opacity: .8; margin-bottom: 4px; }
.lp-row { display: flex; gap: 5px; }
.lp-tile { flex: none; width: 19%; aspect-ratio: 16 / 9; border-radius: 3px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; font-size: 6.5px; color: rgba(255, 255, 255, .8); }
.lp-tile.on { outline: 1.5px solid var(--lp-accent); transform: scale(1.06); }
.lp-sub { font-size: 8px; opacity: .7; margin-top: 3px; }
.lp-grid { margin-top: 10px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px 6px; }
.lp-grid .lp-tile { width: auto; }
.lp-grid span { font-size: 6px; opacity: .8; display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.menu-apps { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.menu-apps-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.menu-apps-head b { font-weight: 500; }
.menu-apps .seg { margin: 0; }
.menu-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.menu-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); max-height: 320px; overflow: auto; }
.menu-list:empty::after { content: attr(data-empty); display: block; padding: 16px; color: var(--muted); font-size: 13px; }
.menu-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-top: 1px solid var(--line); }
.menu-list li:first-child { border-top: 0; }
.menu-picker > div { min-width: 0; }
.menu-list .cell-stack { flex: 1; min-width: 0; }
.menu-list .t, .menu-list .s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-list .n { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 20px; }
.menu-list .btn.icon { width: 28px; height: 28px; }
.add-pkg { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- hotel e integración ---------- */
.token-box { margin-top: 16px; padding: 16px; border: 1px solid rgba(10, 99, 235, .3); background: var(--accent-soft); border-radius: var(--r-ctl); display: flex; flex-direction: column; gap: 8px; }
.token-row { display: flex; gap: 8px; align-items: center; }
.token-row code { flex: 1; font-size: 13px; padding: 8px 12px; background: var(--card); word-break: break-all; }
.test-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; align-items: end; }
.greetings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.greetings label { display: grid; grid-template-columns: 88px 1fr; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline select { width: auto; }
.guest { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.guest .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang { font: 500 11px var(--mono); text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: var(--raised); color: var(--text-2); margin-left: 6px; }

.usage-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.usage-row .seg { margin: 0; }
.keys { display: flex; flex-wrap: wrap; gap: 4px; }

.bulk-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bulk-tools select { width: auto; }
.bulk-list { border: 1px solid var(--line-strong); border-radius: var(--r-ctl); max-height: 380px; overflow: auto; }
.bulk-list label { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.bulk-list label:first-child { border-top: 0; }
.bulk-list label.off { opacity: .5; cursor: default; }
.bulk-list input { width: 16px; height: 16px; accent-color: var(--accent); }
.app-row .btns { display: flex; gap: 4px; justify-content: flex-end; min-width: 104px; }

.lp-mini.dock { background: linear-gradient(160deg, #2b2f3a, #0d0e12); }
.lp-mini.dock::before { content: ""; position: absolute; left: 18%; right: 18%; bottom: 10%; height: 18%; border-radius: 4px; background: rgba(255,255,255,.14); }
.lp-mini.dock::after { content: ""; position: absolute; left: 50%; bottom: 14%; width: 14%; aspect-ratio: 1; border-radius: 50%; transform: translateX(-50%); background: #2b2d33; box-shadow: 0 0 0 1px #d8b77e, -14px 3px 0 -2px #2b2d33, 14px 3px 0 -2px #2b2d33, -25px 4px 0 -3px #2b2d33, 25px 4px 0 -3px #2b2d33; }
.menu-list select.icon-pick { width: 132px; height: 32px; font-size: 13px; }
.menu-list input.label-pick { width: 132px; height: 32px; font-size: 13px; }
.lp.dock::before { background: linear-gradient(rgba(0,0,0,.4), rgba(0,0,0,0) 40%, rgba(0,0,0,.75)); }
.lp-dock { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 6px; padding: 0 12px 7px; }
.lp-dock::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 52%; border-radius: 10px; background: rgba(18,20,26,.42); border: 1px solid rgba(255,255,255,.14); }
.lp-dock .d { position: relative; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #34363d, #1c1d22 70%); box-shadow: inset 0 0 0 1px rgba(201,164,106,.35); }
.lp-dock .d svg { width: 46%; height: 46%; fill: none; stroke: #d8b77e; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.lp-dock .d img { width: 76%; height: 76%; border-radius: 50%; }
.lp-dock .d.on { box-shadow: inset 0 0 0 1.5px #d8b77e; }
.lp-dock .d .tip { position: absolute; bottom: calc(100% + 5px); font-size: 7px; white-space: nowrap; background: rgba(20,20,24,.85); color: #f3e6cf; padding: 2px 6px; border-radius: 3px; }
.lp.day .lp-dock .d { background: radial-gradient(circle at 35% 30%, #fffdf8, #ece4d6 75%); box-shadow: none; }
.lp.day .lp-dock .d svg { stroke: #1f2a44; }
.lp.day .lp-dock .d.on { box-shadow: inset 0 0 0 1.5px #1f2a44; }
.lp.day .lp-dock .d .tip { background: rgba(255,252,246,.95); color: #1f2a44; }
.lp.day .lp-dock::before { background: rgba(255,255,255,.25); }

/* ---------- conectar ---------- */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 24px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: 0 12px; color: var(--text-2); }
.steps li::before { content: counter(s); grid-row: span 2; width: 28px; height: 28px; border-radius: var(--r-ctl); background: var(--raised); color: var(--text); font: 500 13px/28px var(--mono); text-align: center; }
.steps li b { color: var(--text); font-weight: 500; display: block; margin-bottom: 4px; }
.big-code { margin-top: 12px; display: inline-block; font: 500 20px/1 var(--mono); color: var(--text); background: var(--raised); border: 1px solid var(--line); padding: 12px 16px; border-radius: var(--r-ctl); }

/* ---------- APK ---------- */
.upload .bar { height: 4px; background: var(--raised); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.upload .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }

/* ---------- detalle de equipo ---------- */
dialog.drawer {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: 560px; max-width: 100vw;
  border: 0; border-left: 1px solid var(--line); padding: 0; background: var(--bg); box-shadow: -8px 0 24px rgba(0, 0, 0, .06);
}
dialog.drawer[open] { display: flex; flex-direction: column; animation: enter .3s var(--ease); }
dialog::backdrop { background: rgba(23, 23, 23, .2); }
@keyframes enter { from { transform: translateX(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.drawer-head h2 { display: flex; align-items: center; gap: 8px; }
.drawer-head p { margin-top: 2px; font-size: 13px; }
.drawer-body { padding: 24px; overflow: auto; flex: 1; }
.drawer .card { padding: 20px; }
.drawer .tv.big { max-width: 360px; margin: 0 auto 24px; }
.seg { display: inline-flex; background: var(--raised); border-radius: var(--r-ctl); padding: 4px; margin-bottom: 16px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; height: 28px; line-height: 28px; padding: 0 12px; border-radius: 4px; font-weight: 500; color: var(--text-2); transition: background-color .15s var(--ease), color .15s var(--ease); }
.seg input:checked + span { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
#manualIp.off { opacity: .5; }
.facts { display: grid; grid-template-columns: 144px 1fr; gap: 12px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; line-height: 24px; }
.facts dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; line-height: 24px; word-break: break-word; }
.act-grid { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.act-grid .full { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.act-grid .btn { min-width: 96px; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.log li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.log li:first-child { border-top: 0; padding-top: 0; }
.log .when { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.apps { list-style: none; margin: 12px 0 0; padding: 0; columns: 2; font-size: 13px; }
.apps li { break-inside: avoid; padding: 2px 0; }
details summary { cursor: pointer; color: var(--accent-ink); font-weight: 500; font-size: 13px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; height: 40px; line-height: 40px; padding: 0 16px; border-radius: var(--r-ctl); box-shadow: var(--shadow-float); font-weight: 500; z-index: 100; animation: enter-up .3s var(--ease); }
.toast.err { background: var(--err); }
@keyframes enter-up { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .approve { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .profiles { grid-template-columns: 1fr; }
  .profile-list { position: static; flex-direction: row; flex-wrap: wrap; }
  .launcher-split { grid-template-columns: 1fr; }
  #deviceTable th:nth-child(4), #deviceTable td:nth-child(4), #deviceTable th:nth-child(5), #deviceTable td:nth-child(5) { display: none; }
  .test-grid { grid-template-columns: 1fr 1fr; }
  .main { padding: 24px 20px; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav button { width: auto; }
  .nav-sep { display: none; }
  .main { padding: 20px 16px; }
  .grid2, .grid3, .toggles, .templates, .launcher-split, .menu-picker, .test-grid, .greetings { grid-template-columns: 1fr; }
  .search-box input { width: 100%; }
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
}

/* Los radios/casillas ocultos quedan dentro de su etiqueta (no ensanchan la página) */
.seg label, .tpl, .toggle { position: relative; }
.seg input, .tpl input, .toggle input { left: 0; top: 0; width: 1px; height: 1px; }

/* Sin Hotelería no se muestra la columna Huésped */
#deviceTable.no-guest th:nth-child(2), #deviceTable.no-guest td:nth-child(2) { display: none; }

/* Repositorio: nombres largos se recortan para que quepan las acciones */
#apkList td:first-child .cell-stack { max-width: 340px; }
#apkList td:first-child .t, #apkList td:first-child .s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#apkList td:nth-child(5) .tag { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

/* Dock: la lista elegida necesita espacio para ícono y nombre */
.menu-picker.dock { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.menu-picker.dock #menuChosen .cell-stack { min-width: 96px; }
.menu-picker.dock #menuChosen li { gap: 6px; }

/* clima del launcher */
.weather-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.place-search { display: flex; gap: 8px; }
.place-search input { flex: 1; }
.place-results { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow: auto; }
.place-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: #fff; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.place-item:hover, .place-item:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.place-item .muted { font-size: 12px; }
.lp-weather { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; line-height: 1.1; }
.lp-weather svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.lp-weather small { display: block; font-size: 6px; font-weight: 400; opacity: .7; }
