/* Equital OTT — panel de administración. Requiere base.css. */
.admin-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
/* Menú más angosto en pantallas medianas (notebooks, Windows al 125-150 %): le deja más lugar a las tablas. */
@media (max-width: 1280px) { .admin-shell { grid-template-columns: 212px minmax(0, 1fr); } }
@media (max-width: 1100px) { .admin-shell { grid-template-columns: 188px minmax(0, 1fr); } .sidebar { padding-right: 10px; padding-left: 10px; } }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.side-brand { display: block; padding: 4px 10px 0; }
.side-brand img { height: 28px; width: auto; }
.side-label { margin: -18px 10px 0; color: var(--text-3); font-size: 12px; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--r-s);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav button:hover { background: var(--surface-2); color: var(--text); }
.nav button.active { background: var(--surface-3); color: var(--text); }
.nav svg { flex: none; width: 18px; height: 18px; }
.sidebar-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 6px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-main { min-width: 0; max-width: 1560px; padding: 34px clamp(16px, 3vw, 44px) 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.page-head p { margin-top: 4px; color: var(--text-2); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.kpi .label { color: var(--text-2); font-size: 13px; font-weight: 600; }
.kpi .value { margin-top: 8px; font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi .value small { color: var(--text-3); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.kpi .sub { margin-top: 4px; color: var(--text-3); font-size: 12.5px; }
.kpi .bar { height: 4px; margin-top: 14px; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
.kpi .bar > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width 0.4s var(--ease); }

.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; font-weight: 700; }
.search-box { display: flex; flex: 1 1 260px; align-items: center; gap: 10px; min-width: 0; max-width: 460px; margin-right: auto; }
.panel-head h2 + .search-box { margin-left: 8px; }
.search-field { position: relative; display: flex; flex: 1; min-width: 0; }
.search-field svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; color: var(--text-3); transform: translateY(-50%); pointer-events: none; }
.search-field input { width: 100%; padding: 8px 10px 8px 34px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
.search-field input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.search-count { flex: none; color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) { .panel-head { flex-wrap: wrap; } .search-box { flex-basis: 100%; max-width: none; } }
.table-wrap { position: relative; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.data th { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--text-3); font-size: 12px; font-weight: 600; text-align: left; }
.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr { transition: background 0.15s; }
.data tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.num-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.num-cell .dev-meta { white-space: normal; }
.date-cell { font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }  /* fecha y hora: bajan a dos líneas solo si no hay lugar */
.ch-cell { display: flex; align-items: center; gap: 14px; min-width: 168px; }
.ch-cell > div { min-width: 0; }
.ch-cell .logo-tile { width: 58px; }
.ch-cell strong { font-weight: 600; }
/* La dirección de la fuente, el usuario y el correo se parten en varias líneas si no entran: en una sola ensanchaban
   la tabla y obligaban a correr la página de costado en pantallas chicas o con la escala de Windows al 125-150 %. */
.src { max-width: 420px; margin-top: 2px; color: var(--text-3); font: 12px var(--mono); overflow-wrap: anywhere; }
/* Lo detectado en la señal y los avisos de cada canal se leen enteros (en varias líneas si hace falta). */
.tracks-line { max-width: 560px; margin-top: 4px; color: var(--text-2); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.ch-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.warn-text, .err-text { max-width: 440px; margin-top: 5px; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.warn-text { color: var(--warn); }
.err-text { max-width: 300px; color: var(--danger); }
.state-sub { margin-top: 4px; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.src.count { white-space: nowrap; overflow-wrap: normal; }
.num-right, .data th.num-head { text-align: right; }
.actions-cell { width: 1%; }
.icon-btn { display: inline-grid; width: 32px; padding: 0; place-items: center; }
.icon-btn svg { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.foot-start { margin-right: auto; }

/* Filtros por estado del Panel y avisos que se repiten en varios canales, una sola vez arriba de la tabla. */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.fchip:hover { background: var(--surface-2); color: var(--text); }
.fchip[aria-pressed="true"] { border-color: transparent; background: var(--text); color: var(--bg); }
.fchip .count { color: var(--text-3); font-variant-numeric: tabular-nums; }
.fchip[aria-pressed="true"] .count { color: inherit; opacity: 0.65; }
.notices:empty { display: none; }
.notices { display: grid; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.notice { padding: 10px 14px; border-radius: var(--r); background: rgba(255, 176, 32, 0.1); color: #ffc65c; font-size: 13px; line-height: 1.5; }
.notice strong { color: #ffd27f; }
.link-btn { color: var(--brand-hover, #4c9dff); font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.notice .link-btn { margin-left: 4px; color: #ffd27f; text-decoration: underline; }

/* Cuando la tabla no entra en su recuadro (celular, tablet o ventana angosta), cada fila pasa a ser una tarjeta con el
   nombre de cada dato. Se mide el recuadro y no la pantalla: con el menú al costado queda menos lugar. */
.panel { container-type: inline-size; }
@container (max-width: 700px) {
  table.data.stack thead { display: none; }
  table.data.stack, table.data.stack tbody { display: block; }
  table.data.stack tr { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; gap: 12px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.data.stack tbody tr:last-child { border-bottom: 0; }
  table.data.stack td { display: block; min-width: 0; padding: 0; border: 0; }
  table.data.stack td:first-child, table.data.stack td.actions-cell, table.data.stack td.wide-cell { grid-column: 1 / -1; }
  table.data.stack td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--text-3); font-size: 11.5px; font-weight: 600; }
  table.data.stack .num-right { text-align: left; }
  table.data.stack .actions { flex-wrap: wrap; justify-content: flex-start; }
  table.data.stack td.actions-cell { width: auto; }
  table.data.stack .icon-btn { width: 40px; height: 40px; }  /* para el dedo */
  table.data.stack .ch-cell { min-width: 0; align-items: flex-start; }
  table.data.stack .event-msg, table.data.stack .avail, table.data.stack .share { min-width: 0; }
  table.data.stack .num-cell { white-space: normal; }
  table.data.stack tr { position: relative; }
  table.data.stack td.sel-cell { position: absolute; top: 16px; right: 16px; width: auto; }
  table.data.stack tr td.sel-cell + td[data-label] { grid-column: 1 / -1; padding-right: 34px; }
  table.data.stack tr td.sel-cell + td[data-label]::before { content: none; }
}
/* Recuadro mediano (ventana chica o el menú al costado): celdas con menos margen para que la tabla entre entera. */
@container (max-width: 1000px) {
  .data th, .data td { padding-right: 9px; padding-left: 9px; }
}
@media (max-width: 760px) {
  .filter-bar, .notices { padding: 12px 16px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px 16px; }
  .kpi .value { font-size: 24px; }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.warn-line { max-width: 360px; margin-top: 5px; overflow: hidden; color: var(--warn); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.src-block + .src-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.src-block .hint { margin-top: 8px; }
.warn-line.form-warn { max-width: none; overflow: visible; font-size: 12.5px; line-height: 1.4; white-space: normal; }
.err-line { max-width: 260px; margin-top: 5px; overflow: hidden; color: var(--danger); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.prot { margin-top: 5px; }
.tag.drm { background: rgba(48, 209, 88, 0.14); color: #6ee59a; }

.row-2 { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; }
.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.note { padding: 11px 14px; border: 1px solid rgba(31, 122, 255, 0.3); border-radius: var(--r-s); background: var(--brand-soft); color: var(--text-2); font-size: 13.5px; }
/* Formulario de canal por secciones, con el armador de la fuente y «Probar señal». */
.form-sec { display: grid; gap: 14px; padding: 18px 0 20px; border-top: 1px solid var(--line); }
.dialog-body > .form-sec:first-of-type { padding-top: 4px; border-top: 0; }
.form-sec h3 { color: var(--text-2); font-size: 12.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.row-3 { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 220px); gap: 14px; }
.src-builder { display: grid; gap: 14px; }
.src-builder .row-2 { grid-template-columns: minmax(0, 1fr) 150px; }
.src-builder.custom > :not(.src-custom) { opacity: 0.4; pointer-events: none; }
.src-choices { display: flex; flex-wrap: wrap; gap: 14px 24px; }
.seg-radio { display: inline-flex; gap: 2px; width: max-content; max-width: 100%; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.seg-radio label { position: relative; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio span { display: block; padding: 7px 12px; border-radius: 7px; color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.seg-radio input:checked + span { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); }
.seg-radio input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
.pass-wrap { position: relative; display: block; }
.field .pass-wrap input { padding-right: 80px; }
.pass-toggle { position: absolute; top: 50%; right: 8px; padding: 4px 8px; border-radius: 6px; color: var(--brand-hover); font-size: 12.5px; font-weight: 600; transform: translateY(-50%); }
.src-listen { line-height: 1.5; }
.src-listen code { color: var(--text); }
.src-advanced, .more { color: var(--text-2); font-size: 13px; }
.src-advanced summary, .more summary { width: max-content; color: var(--text-2); font-weight: 600; cursor: pointer; }
.src-advanced summary:hover, .more summary:hover { color: var(--text); }
.src-advanced[open] { display: grid; gap: 8px; }
.src-advanced[open] summary { margin-bottom: 2px; }
.more p { margin-top: 8px; line-height: 1.55; }
.probe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.probe-result { padding: 12px 14px; border: 1px solid; border-radius: var(--r-s); font-size: 13.5px; line-height: 1.5; }
.probe-result.ok { border-color: rgba(48, 209, 88, 0.28); background: rgba(48, 209, 88, 0.07); color: var(--text-2); }
.probe-result.ok > strong { color: #6ee59a; }
.probe-result.err { border-color: rgba(255, 69, 58, 0.3); background: rgba(255, 69, 58, 0.07); color: #ffb3ad; }
.probe-result.err > strong { color: #ff8a80; }
.probe-services { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.probe-services button { display: grid; gap: 1px; padding: 7px 11px; border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); font-size: 13px; text-align: left; }
.probe-services button:hover { background: var(--surface-2); }
.probe-services button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.probe-services small { color: var(--text-3); font-size: 12px; }
#service-field select + input { margin-top: 8px; }
/* Selector de archivo propio: el del navegador cortaba el texto («Ningún archi…eleccionado»). */
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-btn:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.file-name { min-width: 0; overflow: hidden; color: var(--text-3); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .row-3, .src-builder .row-2 { grid-template-columns: 1fr; }
  .seg-radio span { padding: 7px 10px; }
}
#log-dialog { width: min(980px, calc(100vw - 32px)); }
.log-pre {
  max-height: 64vh;
  margin: 0;
  padding: 16px 22px;
  overflow: auto;
  background: var(--bg);
  color: var(--text-2);
  font: 12px/1.7 var(--mono);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---- guía (EPG) y categorías ---- */
.view > .panel + .panel, .epg-grid + .panel { margin-top: 20px; }
.epg-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel-body { display: grid; gap: 16px; padding: 20px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.status-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 20px; margin: 14px 0 0; font-size: 14px; }
.status-list dt { color: var(--text-3); }
.status-list dd { min-width: 0; overflow-wrap: anywhere; }
.demo-hint { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.muted-text { color: var(--text-3); }
.err-text { color: var(--danger); }
.mono-sm { font: 12.5px var(--mono); color: var(--text-2); }
.input.input-sm { width: 240px; height: 34px; padding: 0 12px; font-size: 13px; }
.table-scroll { max-height: 440px; overflow: auto; }
.table-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.row-2.row-2-even { grid-template-columns: 1fr 1fr; }
.order-btns { display: inline-flex; gap: 4px; }
.btn-icon { width: 32px; padding: 0; }
.check.check-top { align-items: flex-start; }
.check.check-top input { margin-top: 2px; }
.check small.hint { display: block; margin-top: 3px; font-weight: 400; }

/* ---- monitoreo ---- */
#mon-kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; max-width: 100%; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.seg button { height: 30px; padding: 0 12px; border-radius: 7px; color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.chart-grid + .panel { margin-top: 0; }
.view > .chart-grid + .panel, .view > .panel + .panel { margin-top: 20px; }
.chart { position: relative; min-height: 210px; }
.chart svg { display: block; overflow: visible; }
.chart .c-grid { stroke: rgba(255, 255, 255, 0.06); }
.chart .c-base { stroke: rgba(255, 255, 255, 0.18); }
.chart .c-tick { fill: var(--text-3); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.chart .c-cross { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -4px 0 10px; color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i, .chart-tip-row i { display: inline-block; width: 14px; height: 2px; border-radius: 1px; }
.chart-empty { display: grid; place-items: center; min-height: 190px; padding: 0 16px; color: var(--text-3); font-size: 13.5px; text-align: center; }
.chart-tip {
  position: absolute;
  top: 8px;
  z-index: 2;
  min-width: 170px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(22, 25, 32, 0.97);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  pointer-events: none;
}
.chart-tip-time { margin-bottom: 6px; color: var(--text-3); font-weight: 600; }
.chart-tip-row { display: flex; align-items: center; gap: 8px; line-height: 1.7; }
.chart-tip-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tip-row span { color: var(--text-2); }
.avail { display: inline-flex; align-items: center; gap: 12px; }
.avail-bar { width: 90px; height: 6px; overflow: hidden; border-radius: 3px; background: var(--surface-3); }
.avail-bar i { display: block; height: 100%; border-radius: inherit; }
.avail-label { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.avail-label b { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: #0b0d12; font-size: 10px; }
.avail.ok .avail-bar i, .avail.ok .avail-label b { background: #0ca30c; }
.avail.warn .avail-bar i, .avail.warn .avail-label b { background: #fab219; }
.avail.danger .avail-bar i, .avail.danger .avail-label b { background: #d03b3b; }
.avail.danger .avail-label b { color: #fff; }
.event-msg { min-width: 220px; overflow-wrap: anywhere; }

/* ---- alertas ---- */
.alerts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.alerts-grid .panel-head .check { font-size: 13px; }
.alerts-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; grid-column: 1 / -1; }
.alerts-actions .form-error { flex: 1; min-width: 200px; }
.row-2.row-2-wide { grid-template-columns: minmax(0, 1fr) 110px; }
@media (max-width: 1100px) {
  .epg-grid, .chart-grid, .alerts-grid { grid-template-columns: 1fr; }
}
.ext-row { display: grid; gap: 4px; margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.ext-row + .ext-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ext-row > code { color: var(--text); font-size: 13px; }
.hint code, .ext-row code, .note code, .notice code { overflow-wrap: anywhere; }

/* ---- ajustes y dispositivos de un usuario ---- */
.test-row { display: flex; gap: 10px; }
.test-row .input { flex: 1; min-width: 0; height: 38px; }
.dev-list { display: grid; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-s); }
.dev-list > p { padding: 10px 12px; font-size: 13.5px; }
.dev-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; font-size: 13.5px; }
.dev-row + .dev-row { border-top: 1px solid var(--line); }
.dev-row strong { font-weight: 600; }
.dev-meta { margin-top: 2px; color: var(--text-3); font-size: 12.5px; }
.watching { color: var(--ok); font-weight: 600; }
.dev-meta.playback-bad { color: var(--warn); font-weight: 600; }
#alerts-smtp a, .hint a { color: var(--brand-hover); text-decoration: underline; }

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    z-index: 10;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    height: auto;
    padding: 10px 16px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .side-brand { padding: 0; }
  .side-brand img { height: 24px; }
  .side-label, .who { display: none; }
  .nav { flex-direction: row; }
  .sidebar-foot { flex-direction: row; margin: 0 0 0 auto; }
}
@media (max-width: 640px) {
  .row-2, .row-2.row-2-even { grid-template-columns: 1fr; }
  .nav svg { display: none; }
}

/* ---- Paquetes de canales ---- */
dialog.dialog-wide { width: min(720px, calc(100vw - 32px)); }
.pk-note:empty { display: none; }
.pk-note { display: grid; gap: 4px; margin-bottom: 16px; padding: 12px 16px; border-radius: var(--r); background: var(--surface-2); color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.pk-note.warn { background: rgba(255, 176, 32, 0.1); color: #ffc65c; }
.pk-note strong { color: var(--text); }
.pk-note.warn strong { color: #ffd27f; }
.pk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pk-tools .search-field { flex: 1 1 220px; }
/* Dentro de un formulario, el estilo de los campos le pisaría el lugar de la lupa. */
.field .search-field input[type="search"] { height: 36px; padding: 0 10px 0 34px; background: var(--surface-2); }
.pk-empty { padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--r-s); color: var(--text-3); font-size: 13.5px; }
.pk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 14px; max-height: 300px; padding: 10px 12px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); }
.pk-list-short { max-height: 180px; }
.pk-list .check { padding: 5px 0; font-size: 13.5px; }
.pk-list .check small { color: var(--text-3); font-weight: 500; }
.pk-list .check.disabled { opacity: 0.6; cursor: default; }
.pk-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pk-tags .tag { height: auto; min-height: 18px; padding: 2px 6px; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
.pk-names { max-width: 360px; color: var(--text-3); font-size: 12.5px; line-height: 1.45; }
.tag.warn-tag { background: rgba(255, 176, 32, 0.14); color: #ffc65c; }
.pk-desc { margin-top: 2px; color: var(--text-3); font-size: 12.5px; }

/* ---- Audiencia ---- */
.aud-note { margin: -6px 0 18px; color: var(--text-3); font-size: 13px; }
.aud-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.aud-grid + .panel, #view-audience > .panel + .panel { margin-top: 20px; }
@media (max-width: 1100px) { .aud-grid { grid-template-columns: 1fr; } }
.heat { position: relative; }
.heat-grid { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; }
.heat-h { color: var(--text-3); font-size: 11px; text-align: left; font-variant-numeric: tabular-nums; }
.heat-d { color: var(--text-2); font-size: 12px; font-weight: 600; }
.heat-c { display: block; aspect-ratio: 1 / 1; border-radius: 3px; transition: transform 0.1s; }
.heat-c:hover { transform: scale(1.25); box-shadow: 0 0 0 2px var(--surface); }
.heat-c.none { background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 5px); }
.heat-legend { display: flex; align-items: center; gap: 3px; margin-top: 12px; color: var(--text-3); font-size: 12px; }
.heat-legend i { width: 22px; height: 10px; border-radius: 2px; }
.heat-legend span:first-child { margin-right: 6px; }
.heat-legend span:last-child { margin-left: 6px; }
.heat-tip { position: absolute; z-index: 3; white-space: nowrap; pointer-events: none; }
.hbars { display: grid; gap: 14px; }
.hbar { display: grid; grid-template-columns: 100px minmax(0, 1fr) 84px; align-items: center; gap: 12px; font-size: 13.5px; }
.hbar-label { color: var(--text-2); font-weight: 600; }
.hbar-track, .share-track { height: 8px; overflow: hidden; border-radius: 4px; background: rgba(255, 255, 255, 0.06); }
.hbar-track i, .share-track i { display: block; height: 100%; border-radius: 4px; background: #3987e5; }
.hbar-value { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.hbar-value small { display: block; color: var(--text-3); font-size: 11.5px; font-weight: 500; }
.share { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.share-track { flex: 1; }
.share b { min-width: 52px; font-variant-numeric: tabular-nums; text-align: right; }
/* El estilo general de los campos no aplica a las opciones del selector ni al envoltorio de la clave. */
.field .seg-radio input[type="radio"] { width: 1px; height: 1px; padding: 0; border: 0; }
.field > .pass-wrap { color: inherit; font-size: inherit; font-weight: inherit; }

/* ---- Usuarios: casillas, acciones en lote y páginas ---- */
.sel-cell { width: 1%; padding-right: 0 !important; }
.sel-cell input { display: block; width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }
.data tbody tr.selected { background: rgba(31, 122, 255, 0.07); }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: rgba(31, 122, 255, 0.1); }
.bulk-bar strong { font-size: 13.5px; }
.bulk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.bulk-pkg { display: inline-flex; align-items: center; gap: 6px; padding-right: 8px; border-right: 1px solid var(--line-2); }
.bulk-pkg select { height: 32px; max-width: 220px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.pager span { margin-right: auto; }
@media (max-width: 760px) {
  .bulk-bar, .pager { padding: 10px 16px; }
  .bulk-actions { margin-left: 0; }
}

/* Geobloqueo (Ajustes) */
.geo-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 14px; }
.geo-recent { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.geo-recent li { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.geo-recent time, .geo-recent em { color: var(--text-3); font-style: normal; }

/* Reporte de abonados por canal (Audiencia) */
.panel-note { margin: 14px 20px 0; }
.input.subs-month { width: 190px; }
