/* Smart Screen Services · panel 2026 */
:root {
    --brand: #CA4615;
    --brand-hover: #b23c10;
    --brand-dark: #593121;
    --brand-soft: #fdf0ea;
    --brand-ring: rgba(202, 70, 21, .18);
    --bg: #f5f5f4;
    --surface: #ffffff;
    --surface-2: #fafaf9;
    --text: #1c1917;
    --muted: #78716c;
    --line: #e7e5e4;
    --ok: #16a34a;
    --ok-soft: #dcfce7;
    --warn: #eab308;
    --late: #f97316;
    --down: #dc2626;
    --down-soft: #fee2e2;
    --info: #2563eb;
    --info-soft: #dbeafe;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 4px 16px rgba(28, 25, 23, .05);
    --shadow-lg: 0 12px 40px rgba(89, 49, 33, .14);
    --sidebar: 248px;
    font-family: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
h1, h2, h3 { font-family: "Barlow Condensed", "Inter Tight", sans-serif; font-weight: 600; letter-spacing: .01em; margin: 0; color: var(--text); }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .85em; }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.2rem; padding: 1.3rem 1rem; background: var(--surface); box-shadow: 1px 0 0 var(--line); overflow-y: auto; }
.sidebar .logo { display: block; padding: .2rem .5rem .4rem; }
.sidebar .logo img { width: 150px; display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .9rem .75rem .35rem; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border-radius: var(--radius-sm); color: #44403c; font-weight: 500; transition: background .15s, color .15s; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav a.active svg { opacity: 1; }
.sidebar .account { margin-top: auto; display: flex; align-items: center; gap: .7rem; padding: .7rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 600; font-size: .85rem; flex: none; }
.account .who { line-height: 1.25; min-width: 0; }
.account .who strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account .who a { font-size: .8rem; }
.content { min-width: 0; padding: 1.8rem 2.2rem 3rem; max-width: 1360px; width: 100%; }
.mobile-bar { display: none; }

/* ---------- Encabezado de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head p { margin: .25rem 0 0; color: var(--muted); }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.4rem; margin-bottom: 1.25rem; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card.flush .card-head { padding: 1.1rem 1.4rem 0; }
.card-head .meta { color: var(--muted); font-size: .88rem; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }

/* Indicadores */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.15rem; }
.stat .value { font-family: "Barlow Condensed", sans-serif; font-size: 2.1rem; font-weight: 600; line-height: 1; }
.stat .label { color: var(--muted); font-size: .82rem; margin-top: .35rem; }
.stat.accent { background: linear-gradient(135deg, var(--brand), #e0662f); border-color: transparent; color: #fff; }
.stat.accent .label { color: rgba(255, 255, 255, .85); }

/* Tarjeta de entidad (ciudades, grupos) */
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .6rem; transition: box-shadow .15s, transform .15s; }
.tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.tile .tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.tile .numbers { display: flex; gap: 1.2rem; }
.tile .numbers div { font-size: .8rem; color: var(--muted); }
.tile .numbers strong { display: block; font-size: 1.25rem; color: var(--text); font-family: "Barlow Condensed", sans-serif; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem 1rem; vertical-align: middle; }
thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tbody tr + tr td { box-shadow: inset 0 1px 0 var(--line); }
tbody tr:hover td { background: #fcfbfa; }
td .sub { display: block; color: var(--muted); font-size: .82rem; }
td.num, th.num { text-align: right; }
.row-link { color: var(--text); font-weight: 500; }
.row-link:hover { color: var(--brand); }

/* ---------- Etiquetas y estado ---------- */
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .45rem; vertical-align: middle; box-shadow: 0 0 0 3px rgba(0, 0, 0, .04); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.warn { background: var(--warn); } .dot.late { background: var(--late); }
.dot.down { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
.dot.never { background: #d6d3d1; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; background: #f5f5f4; color: #57534e; white-space: nowrap; }
.badge.brand, .badge.external { background: var(--brand-soft); color: var(--brand); }
.badge.internal, .badge.info { background: var(--info-soft); color: var(--info); }
.badge.ok { background: var(--ok-soft); color: #15803d; }
.badge.off { background: var(--down-soft); color: #b91c1c; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; color: #44403c; }

/* ---------- Barra de filtros ---------- */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding: 1rem 1.4rem; }
.toolbar .input { margin: 0; }
.toolbar input[type=search], .toolbar select { width: auto; min-width: 180px; }
.toolbar .grow { flex: 1; min-width: 220px; }
.toolbar .grow input { width: 100%; }

/* ---------- Formularios ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.1rem; }
.form-grid .full { grid-column: 1 / -1; }
.input { margin-bottom: 1rem; }
label { display: block; font-weight: 500; font-size: .88rem; margin-bottom: .35rem; color: #44403c; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=time], input[type=search], input[type=tel], select, textarea {
    width: 100%; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.input.error input, .input.error select { border-color: var(--down); }
.error-message { color: var(--down); font-size: .82rem; margin-top: .3rem; }
.help { color: var(--muted); font-size: .8rem; margin-top: .3rem; }
.checkbox-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .4rem; }
.checkbox-list label, label.check { display: flex; align-items: center; gap: .55rem; font-weight: 400; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; margin: 0; background: #fff; }
.checkbox-list label:has(input:checked), label.check:has(input:checked) { background: var(--brand-soft); border-color: var(--brand-ring); color: var(--brand-dark); }
input[type=checkbox] { accent-color: var(--brand); width: 16px; height: 16px; }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; padding-top: .4rem; }
.secret { display: flex; gap: .5rem; align-items: center; }
.secret input { flex: 1; }

/* ---------- Botones ---------- */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: var(--brand); color: #fff; border: 1px solid transparent; border-radius: var(--radius-sm); padding: .58rem 1.05rem; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; transition: background .15s, box-shadow .15s; text-decoration: none; white-space: nowrap; }
.btn:hover, button:hover { background: var(--brand-hover); color: #fff; }
.btn:focus-visible, button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--brand-ring); }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: .35rem .7rem; font-size: .82rem; }
.btn.danger { background: #fff; color: var(--down); border-color: #fecaca; }
.btn.danger:hover { background: var(--down-soft); }

/* Pestañas */
.tabs { display: inline-flex; gap: .25rem; padding: .25rem; background: #ecebe9; border-radius: 11px; }
.tabs a { padding: .4rem .9rem; border-radius: 8px; color: #57534e; font-weight: 500; font-size: .88rem; }
.tabs a.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.tabs a .count { color: var(--muted); font-weight: 400; margin-left: .25rem; }

/* ---------- Mensajes ---------- */
.message { display: flex; gap: .6rem; align-items: center; padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.2rem; background: var(--ok-soft); color: #166534; font-weight: 500; }
.message.error { background: var(--down-soft); color: #991b1b; }
.message.warning { background: #fef9c3; color: #854d0e; }
.message.hidden { display: none; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }

/* Lista de bitácora */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.timeline li { display: flex; gap: .7rem; font-size: .88rem; }
.timeline li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-top: .45rem; flex: none; }

/* Paginación */
.paginator { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.4rem; color: var(--muted); font-size: .85rem; }
.pagination { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.pagination a, .pagination li.active a { display: block; padding: .3rem .65rem; border-radius: 7px; color: #57534e; }
.pagination li.active a { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.pagination li.disabled a { opacity: .4; pointer-events: none; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: radial-gradient(1200px 600px at 10% -10%, #fde6db 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #f3e3da 0%, transparent 55%), var(--bg); }
.login-box { width: 100%; max-width: 390px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 20px; padding: 2.2rem 2rem; box-shadow: var(--shadow-lg); }
.login-box img { display: block; max-width: 190px; margin: 0 auto 1.6rem; }
.login-box button { width: 100%; padding: .7rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 980px) {
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
    .app.nav-open .sidebar { transform: none; }
    .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; background: var(--surface); box-shadow: 0 1px 0 var(--line); position: sticky; top: 0; z-index: 10; }
    .mobile-bar img { height: 34px; }
    .mobile-bar button { background: var(--surface-2); color: var(--text); border-color: var(--line); }
    .content { padding: 1.2rem 1rem 2.5rem; }
    .form-grid { grid-template-columns: 1fr; }
    th, td { padding: .6rem .7rem; }
}
.btn svg, button svg { width: 16px; height: 16px; }
.card.narrow { max-width: 760px; }
.badge svg { width: 13px; height: 13px; }
.bulk-bar { background: var(--brand-soft); margin: 0 1rem .5rem; border-radius: 10px; padding: .6rem .9rem; }
.bulk-bar[hidden] { display: none; }
.section-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 1rem 0 .5rem; }
.stack { display: flex; flex-direction: column; gap: .6rem; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .65rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.list-row .sub { display: block; color: var(--muted); font-size: .8rem; }
.app > div { min-width: 0; }
.card-head h2, h2.with-icon { display: flex; align-items: center; gap: .45rem; }
h2 svg { width: 20px; height: 20px; color: var(--brand); }
@media (max-width: 820px) {
    .toolbar > *, .toolbar select, .toolbar input[type=search] { width: 100%; min-width: 0; }
    .page-head .actions, .page-head .actions .btn { width: 100%; }
}
.stat { position: relative; }
.stat-icon { position: absolute; top: .9rem; right: .9rem; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #f5f5f4; color: #57534e; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.brand { background: var(--brand-soft); color: var(--brand); }
.stat-icon.ok { background: var(--ok-soft); color: #15803d; }
.stat-icon.info { background: var(--info-soft); color: var(--info); }
.stat .value { padding-right: 2.6rem; }
/* Selector de destinos */
.picker-row { display: grid; grid-template-columns: 150px 1fr auto auto; gap: .5rem; align-items: center; }
.chip.target { gap: .35rem; padding: .3rem .4rem .3rem .65rem; }
.chip.target small { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; opacity: .75; }
.chip.target button { background: transparent; color: inherit; border: 0; padding: 0 .25rem; font-size: 1rem; line-height: 1; opacity: .6; }
.chip.target button:hover { background: transparent; color: inherit; opacity: 1; }
.chip.include { background: var(--brand-soft); border-color: var(--brand-ring); color: var(--brand-dark); }
.chip.exclude { background: var(--down-soft); border-color: #fecaca; color: #991b1b; }
.target-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; min-height: 2rem; align-items: center; }
.picker-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; }
.picker-actions:not(:has(> :not([hidden]))) { display: none; }
.picker-actions [hidden] { display: none; }
.picker-actions [data-role=cleared] { display: inline-flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.picker-actions [data-role=cleared][hidden] { display: none; }
.reach { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border-radius: var(--radius-sm); background: var(--ok-soft); color: #14532d; }
.reach.zero { background: #fef9c3; color: #713f12; }
.reach strong { font-family: "Barlow Condensed", sans-serif; font-size: 1.9rem; line-height: 1; }
.reach .sep { width: 1px; align-self: stretch; background: currentColor; opacity: .15; }
.reach.saved { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.reach-compare { display: grid; gap: .6rem; margin-top: 1rem; }
.reach-compare [data-role=diff] { font-weight: 600; }
/* Videos */
.thumb { width: 96px; aspect-ratio: 16 / 9; border-radius: 8px; object-fit: cover; background: #e7e5e4; display: block; }
.thumb.placeholder { display: grid; place-items: center; color: #a8a29e; }
.thumb.placeholder svg { width: 22px; height: 22px; }
.media-cell { display: flex; gap: .8rem; align-items: center; }
.player { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: #0c0a09; display: block; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; padding: 2rem 1rem; border-radius: var(--radius); background: var(--surface-2); border: 1.5px dashed #d6d3d1; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.dropzone:hover, .dropzone.drag { background: var(--brand-soft); border-color: var(--brand); }
.dropzone svg { width: 30px; height: 30px; color: var(--brand); }
.dropzone input { display: none; }
.dropzone .file-name { font-weight: 600; color: var(--text); }
.type-choice { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.type-choice label { display: block; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; margin: 0; font-weight: 400; }
.type-choice label strong { display: block; }
.type-choice label:has(input:checked) { background: var(--brand-soft); border-color: var(--brand-ring); }
.type-choice input { display: none; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; font-size: .9rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
@media (max-width: 820px) { .picker-row { grid-template-columns: 1fr 1fr; } }
.stat-icon.down { background: var(--down-soft); color: var(--down); }
/* Equipos detectados */
.card.detected { background: linear-gradient(180deg, #fffaf6, #fff); border-color: var(--brand-ring); }
.detected-row { flex-wrap: wrap; }
.detected-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.detected-actions input, .detected-actions select { width: auto; min-width: 190px; padding: .45rem .6rem; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.1rem; border-radius: var(--radius); background: var(--brand-soft); color: var(--brand-dark); margin-bottom: 1.25rem; }
.notice .notice-text { display: flex; align-items: center; gap: .7rem; }
.notice svg { width: 20px; height: 20px; color: var(--brand); flex: none; }
/* Reproductor de la lista de una pantalla */
.player-bar { display: flex; align-items: center; gap: .5rem; margin-top: .7rem; flex-wrap: wrap; }
.player-bar #pl-now { margin-left: .3rem; color: var(--muted); }
.player-bar .btn.step { font-size: 1.1rem; line-height: 1; padding: .3rem .75rem; }
tr.pl-row.playing td { background: var(--brand-soft); }
tr.pl-row.playing .row-link { color: var(--brand); }
.card-head form select { width: auto; padding: .4rem .6rem; }
/* Soporte */
.health-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.health-card .traffic { display: flex; gap: 1rem; font-family: "Barlow Condensed", sans-serif; font-size: 1.5rem; font-weight: 600; }
.health-card .traffic .dot { width: .7rem; height: .7rem; }
.worst { list-style: none; margin: .7rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; }
.worst li { display: flex; justify-content: space-between; gap: .5rem; }
.worst a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worst a:hover { color: var(--brand); }
.level-down { color: var(--down); } .level-warn { color: #a16207; } .level-ok { color: #15803d; }
.health-table td.health { white-space: nowrap; min-width: 110px; }
.meter { display: block; height: 5px; border-radius: 99px; background: #f0eeec; margin-top: .3rem; overflow: hidden; max-width: 110px; }
.meter span { display: block; height: 100%; border-radius: 99px; }
.level-bg-ok { background: var(--ok); } .level-bg-warn { background: var(--warn); } .level-bg-down { background: var(--down); } .level-bg-never { background: #d6d3d1; }
tr.stale td { opacity: .55; }
.health-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.worst strong { white-space: nowrap; }
.worst a { min-width: 0; }
@media (max-width: 1280px) { .health-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .health-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .health-cards { grid-template-columns: minmax(0, 1fr); } }
.export-box { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: .9rem; padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.export-box .export-text { display: flex; gap: .7rem; align-items: flex-start; min-width: 0; flex: 1; }
.export-box .export-text > svg { width: 20px; height: 20px; color: var(--brand); flex: none; margin-top: .15rem; }
.export-box .meter { max-width: 260px; }
.export-box .meter[hidden] { display: none; }
.export-box form { margin: 0; }
.export-box .sub { display: block; margin-top: .1rem; }
/* Vista previa con la orientación de la TV (solo visual) */
.tv-frame { position: relative; }
.tv-frame.rotated { aspect-ratio: 9 / 16; max-width: 340px; margin: 0 auto; overflow: hidden; border-radius: var(--radius-sm); background: #0c0a09; box-shadow: 0 0 0 6px #1c1917; }
.tv-frame.rotated .player { position: absolute; top: 50%; left: 50%; width: 177.78%; height: auto; aspect-ratio: 16 / 9; border-radius: 0; transform: translate(-50%, -50%) rotate(var(--rotation)); }
.link-button { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 500; cursor: pointer; }
.link-button:hover { background: none; color: var(--brand-hover); text-decoration: underline; }
.progress { display: flex; align-items: center; gap: .7rem; max-width: 340px; margin: .7rem auto 0; }
.progress[hidden] { display: none; }
.progress-time { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 6.5em; }
.progress-track { flex: 1; height: 6px; border-radius: 99px; background: #e7e5e4; cursor: pointer; position: relative; }
.progress-track:hover, .progress-track:focus-visible { height: 8px; outline: none; }
.progress-fill { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--brand); transition: width .2s linear; }
/* Pantalla sin servicio de WiFi: sin conexión esperada, no es falla */
.dot.nowifi { background: transparent; box-shadow: inset 0 0 0 2px #a8a29e; }
.stat .label .sub { display: block; font-size: .78rem; margin-top: .15rem; }
/* Tablas compactas (inicio) */
table.compact th, table.compact td { padding: .45rem .75rem; }
table.compact td .sub { font-size: .78rem; }
table.compact .status-col { width: 1%; padding-right: 0; text-align: center; }
table.compact .status-col .dot { margin-right: 0; }
.nowrap { white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: -.4rem 0 1rem; font-size: .82rem; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card.flush .card-head { padding-bottom: .2rem; }
@media (max-width: 820px) {
    table.compact th, table.compact td { padding: .4rem .5rem; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .stat { padding: .8rem .9rem; }
    .stat .value { font-size: 1.7rem; }
    .stat-icon { width: 32px; height: 32px; top: .7rem; right: .7rem; }
}
/* Columnas solo de escritorio / dato solo en celular */
.mobile-only { display: none; }
@media (max-width: 820px) {
    .desktop-only { display: none; }
    .mobile-only { display: block; }
}
table .mobile-only { display: none; }
@media (max-width: 820px) {
    table .desktop-only { display: none; }
    table .mobile-only { display: block; }
}
.net { display: block; line-height: 1.7; }
/* Ícono de conexión (WiFi) */
.status-icon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; vertical-align: middle; flex: none; }
.status-icon svg { width: 16px; height: 16px; }
.status-icon.ok { color: #15803d; background: var(--ok-soft); }
.status-icon.warn { color: #a16207; background: #fef3c7; }
.status-icon.down { color: var(--down); background: var(--down-soft); }
.status-icon.never { color: #78716c; background: #f5f5f4; }
.status-icon.nowifi { color: #a8a29e; background: transparent; box-shadow: inset 0 0 0 1px #e7e5e4; }
.status-label { margin-left: .45rem; vertical-align: middle; }
.legend .status-icon { margin-right: .35rem; width: 20px; height: 20px; }
.legend .status-icon svg { width: 14px; height: 14px; }
.badge.warn-badge { background: #fef3c7; color: #a16207; }
/* Selector de idioma */
.lang-switch { display: inline-flex; padding: 2px; border-radius: 8px; background: #ecebe9; margin-left: auto; flex: none; }
.lang-switch a { padding: .15rem .45rem; border-radius: 6px; font-size: .72rem; font-weight: 600; color: #78716c; }
.lang-switch a.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.login-lang { display: flex; justify-content: center; margin-top: 1.2rem; }
.login-lang .lang-switch { margin-left: 0; }
/* Selección de videos para exportar */
.export-pick { margin-top: .6rem; padding: .9rem 1rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.export-pick[hidden] { display: none; }
.export-pick-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.export-pick-head .actions { margin-left: auto; gap: .8rem; }
.export-pick-list { display: flex; flex-direction: column; gap: .3rem; max-height: 340px; overflow-y: auto; padding-right: .2rem; }
.export-pick-list label.check { padding: .4rem .6rem; gap: .6rem; }
.export-pick-list .pick-pos { min-width: 1.6rem; text-align: right; }
.export-pick-list .pick-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.export-box .actions { flex-wrap: nowrap; }
/* Ordenar por columna */
thead th a { color: inherit; text-decoration: none; }
thead th a:hover { color: var(--brand); }
thead th a.asc::after, thead th a.desc::after { content: ""; display: inline-block; margin-left: .3rem; border: 4px solid transparent; vertical-align: middle; }
thead th a.asc::after { border-bottom-color: var(--brand); margin-top: -4px; }
thead th a.desc::after { border-top-color: var(--brand); margin-top: 4px; }
thead th a.asc, thead th a.desc { color: var(--brand); }
.sort-pair { font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: .35rem; }
.paginator-info { display: inline-flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.page-size { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: 400; font-size: .85rem; color: var(--muted); }
.page-size select { width: auto; padding: .25rem .5rem; }

/* Tooltips de ayuda (webroot/js/hints.js) */
.hint { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; margin: 0 0 0 .2rem; border: 0; border-radius: 50%; background: none; color: #a8a29e; cursor: help; vertical-align: middle; flex: none; }
.hint svg { width: 14px; height: 14px; }
.hint:hover, .hint:focus-visible { color: var(--brand); background: var(--brand-soft); outline: none; }
[data-hint]:not(.hint):not(a) { cursor: help; }
.tooltip { position: fixed; top: 0; left: 0; z-index: 1000; max-width: min(300px, calc(100vw - 16px)); padding: .55rem .75rem; border-radius: 10px; background: #292524; color: #fafaf9; font: 400 .8rem/1.45 "Inter Tight", system-ui, sans-serif; text-align: left; text-transform: none; letter-spacing: normal; white-space: pre-line; box-shadow: 0 8px 24px rgba(28, 25, 23, .22); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s ease; }
.tooltip.visible { opacity: 1; visibility: visible; }
.stat .label .hint { margin-top: -2px; }
h3.with-icon { display: flex; align-items: center; gap: .4rem; }
h3 svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
h2.with-icon svg { flex: none; }

/* Temporadas */
.badge.season { background: #f3e8ff; color: #7e22ce; }
.inline-select select { width: 100%; max-width: 260px; padding: .35rem .5rem; }
.season-videos { display: flex; flex-wrap: wrap; gap: .4rem; }
.season-thumb { display: grid; place-items: center; width: 72px; height: 42px; border-radius: 8px; overflow: hidden; background: #f5f5f4; color: #a8a29e; text-decoration: none; box-shadow: 0 0 0 1px var(--line); }
.season-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.season-thumb svg { width: 18px; height: 18px; }
.season-thumb.ready { box-shadow: 0 0 0 2px var(--ok); }
.season-thumb.ending { box-shadow: 0 0 0 2px var(--warn); }
.season-thumb.more { font-size: .74rem; font-weight: 600; color: #57534e; }

/* Avisos seguidos en el inicio: más compactos */
.notice + .notice { margin-top: -.55rem; }

/* Documentación */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
.doc-grid .card { margin: 0; }
.doc-list { margin: .7rem 0 0; padding-left: 1.1rem; display: grid; gap: .4rem; font-size: .92rem; }
.doc-faq details { padding: .9rem 1.4rem; }
.doc-faq details + details { border-top: 1px solid var(--line); }
.doc-faq summary { cursor: pointer; font-weight: 600; }
.doc-faq p { margin: .5rem 0 0; color: #57534e; }
.grid-2 > * { min-width: 0; }

/* Selector de ciudad, pie de página y ajustes en línea */
.city-bar { display: flex; align-items: center; justify-content: flex-end; gap: .45rem; margin-bottom: .6rem; color: var(--muted); }
.city-bar svg { width: 18px; height: 18px; flex: none; }
.city-bar select { width: auto; padding: .35rem .6rem; font-size: .88rem; }
/* Siempre visible al fondo de la pantalla, a la derecha del menú */
.app-footer { position: fixed; left: var(--sidebar); right: 0; bottom: 0; z-index: 5; padding: .45rem 1rem; text-align: center; color: var(--muted); font-size: .8rem; background: var(--bg); box-shadow: 0 -1px 0 var(--line); }
.content { padding-bottom: 3.5rem; }
.app-footer a { color: var(--brand); font-weight: 600; }
.inline-setting { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.inline-setting-field { display: inline-flex; align-items: center; gap: .5rem; }
.inline-setting-field input { width: 76px; }

/* Orden de videos */
.order-save { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; position: sticky; top: .5rem; z-index: 4; }
.order-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.order-columns > * { min-width: 0; margin: 0; }
.order-list { list-style: none; margin: 0; padding: 0 .6rem .6rem; }
.order-item { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; border-radius: 9px; cursor: grab; }
.order-item + .order-item { box-shadow: 0 -1px 0 var(--line); }
.order-item.dragging { opacity: .45; }
.order-pos { width: 1.6rem; text-align: right; color: var(--muted); font-size: .82rem; flex: none; }
.order-thumb { display: grid; place-items: center; width: 60px; height: 34px; border-radius: 6px; object-fit: cover; background: #e7e5e4; color: #a8a29e; flex: none; }
.order-thumb svg { width: 16px; height: 16px; }
.order-title { flex: 1; min-width: 0; font-size: .88rem; overflow-wrap: anywhere; }
.order-move { display: inline-flex; gap: .2rem; flex: none; }
.login-link { margin: .8rem 0 0; text-align: center; font-size: .85rem; }

/* Menú lateral compacto */
.sidebar { overflow-y: auto; gap: .7rem; padding-top: 1rem; padding-bottom: .9rem; }
.nav a { padding-top: .38rem; padding-bottom: .38rem; }
.nav-group summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; user-select: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: ""; width: 6px; height: 6px; margin-right: .3rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.nav-group[open] summary::after { transform: rotate(45deg); }
@media (max-width: 820px) {
    .app-footer { left: 0; }
}
.order-title .sub { display: block; color: var(--muted); font-size: .78rem; }
.tab-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.tabs a { display: inline-flex; align-items: center; gap: .35rem; }
.tabs a svg { width: 15px; height: 15px; flex: none; opacity: .75; }
.tabs a .count { margin-left: 0; }
.tabs a.active svg { color: var(--brand); opacity: 1; }
.tab-row .tabs { max-width: 100%; flex-wrap: wrap; }

/* Cambiar vigencia en grupo */
.bulk-dates { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .4rem .8rem; }
.bulk-dates[hidden] { display: none; }
.bulk-dates label { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; margin: 0; }
.bulk-dates input[type=date] { width: auto; padding: .3rem .45rem; }
.bulk-dates .help { flex-basis: 100%; margin: 0; }

/* Fechas siempre en mm/dd/aaaa (webroot/js/datefield.js) */
.date-field { position: relative; display: inline-block; width: 100%; max-width: 100%; }
.date-field input[type=text] { width: 100%; padding-right: 2.3rem; }
.date-field-open { position: absolute; top: 50%; right: .3rem; transform: translateY(-50%); display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.date-field-open svg { width: 17px; height: 17px; }
.date-field-open:hover { color: var(--brand); }
.date-field-open:disabled { opacity: .4; cursor: default; }
.date-field-real { position: absolute; right: 0; bottom: 0; width: 1px !important; height: 1px; padding: 0 !important; border: 0; opacity: 0; pointer-events: none; }
.bulk-dates .date-field { width: 150px; }

/* Copiar programación */
.copy-programming { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; }
.copy-programming select { flex: 1 1 260px; max-width: 460px; width: auto; }
.copy-programming label.check { margin: 0; }

/* Pantallas de error */
.error-box { width: 100%; max-width: 460px; padding: 2.2rem 2rem; text-align: center; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.error-box img { display: block; max-width: 170px; margin: 0 auto 1.2rem; }
.error-code { margin: 0; font-family: "Barlow Condensed", sans-serif; font-size: 4.2rem; font-weight: 600; line-height: 1; color: var(--brand); }
.error-box h1 { margin: .4rem 0 .6rem; font-size: 1.6rem; }
.error-text { margin: 0; color: #57534e; }
.error-note { margin: .9rem 0 0; padding: .55rem .8rem; border-radius: 10px; background: var(--ok-soft); color: #15803d; font-size: .86rem; }
.error-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }

/* Imagen convertida en video */
.image-options { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin-top: 1rem; align-items: start; }
.image-options[hidden] { display: none; }
.image-preview { aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.image-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.image-warning { margin: .4rem 0 0; font-size: .82rem; }
@media (max-width: 600px) { .image-options { grid-template-columns: 1fr; } }
.video-preview { margin-top: 1rem; }
.video-preview[hidden] { display: none; }
.image-preview video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
