/* Estilos comunes de la web: el CSS que antes estaba copiado en cada plantilla.
   Se carga en el <head> de cada página (partials/head.html) ANTES de su propio <style>,
   así que lo que una página define después manda sobre esto. Generado con
   consolidar.py: una regla solo está aquí si no cambia cómo se ve ninguna página. */

/* Base del sistema de diseño (variables de eduradar.css): Roboto y la tinta en toda la web,
   también en los controles de formulario, que no heredan la fuente si no se les pide.
   line-height 1.33 es el «normal» de Segoe UI, con el que se maquetaron las páginas: el de
   Roboto es 1.17 y lo que no fija su altura de línea quedaría 2 px más apretado. */
body { font-family: var(--font-sans); color: var(--color-text); line-height: 1.33; }
button, input, select, textarea { font-family: inherit; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.account-tabs { display: flex; gap: 4px; margin-bottom: 24px; box-shadow: inset 0 -1px 0 #e5e5e5; overflow-x: auto; scrollbar-width: none; }
.account-tab { padding: 9px 14px; font-size: 13px; font-weight: 500; color: #525252; text-decoration: none; border-bottom: 2px solid transparent; flex: none; white-space: nowrap; }
.account-tab:hover { color: #141f31; }
.account-tab.active { color: #141f31; border-bottom-color: #141f31; }
.field { margin-bottom: 14px; }
.btn-submit { padding: 9px 18px; background: #141f31; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.btn-submit:hover { background: #2c3546; }
.success { background: #dcfce7; color: #166534; font-size: 12px; padding: 9px 11px; border-radius: 8px; margin-bottom: 14px; }
.sidebar-section-nav { display: flex; flex-direction: column; padding: 8px; border-bottom: 1px solid #f0f0f0; gap: 2px; }
.sidebar-sec-btn:hover { background: #f5f5f5; color: #141f31; }
.app-body { display: flex; flex-direction: column; height: calc(100vh - 52px - 38px); }
.layout { display: flex; flex: 1; overflow: hidden; }
.sidebar-label { font-size: 11px; color: #6b6b6b; text-transform: uppercase; letter-spacing: 0.05em; padding: 14px 16px 6px; }
.admin-nav { display: flex; flex-direction: column; padding: 8px; gap: 2px; }
.admin-nav-btn { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: none; background: none; cursor: pointer; font-size: 13px; font-weight: 500; color: #525252; width: 100%; text-align: left; transition: background 0.1s; text-decoration: none; }
.admin-nav-btn:hover { background: #f5f5f5; color: #141f31; }
.admin-nav-btn.active { background: #141f31; color: #fff; }
.ops-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.op-tile { background: #fff; border: 1px solid #e5e5e5; border-radius: 12px; padding: 20px; text-decoration: none; display: block; transition: border-color 0.15s, box-shadow 0.15s; }
.op-tile:hover { border-color: #c7d2fe; box-shadow: 0 8px 24px rgba(20,31,49,0.06); }
.op-tile .icon { width: 38px; height: 38px; border-radius: 10px; background: #f0f9ff; color: #1156b8; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 14px; }
.op-tile h2 { font-size: 14px; margin-bottom: 4px; }
.op-tile p { font-size: 12px; color: #525252; line-height: 1.5; }
.breadcrumb { font-size: 12px; color: #6b6b6b; margin-bottom: 6px; }
.summary-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.summary-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 14px 18px; min-width: 160px; }
.summary-card .n { font-size: 22px; font-weight: 700; color: #141f31; }
.summary-card .lbl { font-size: 11px; color: #6b6b6b; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-bad { background: #fee2e2; color: #991b1b; }
.badge-off { background: #f5f5f5; color: #6b6b6b; }
.canal-tag { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; padding: 2px 7px; border-radius: 5px; background: #eef2ff; color: #3730a3; }
.stats-txt { color: #525252; font-size: 12px; }
.svc-card:last-child { border-bottom: none; }
.sub-row-label { font-size: 13px; font-weight: 500; color: #141f31; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: #e5e5e5; border-radius: 999px; cursor: pointer; transition: background 0.15s; }
.pref-toggle-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #3730a3; margin-bottom: 12px; }
.switch { position: relative; width: 34px; height: 20px; flex-shrink: 0; }
.switch-track::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.15s; }
.switch input:checked + .switch-track { background: #3730a3; }
.switch input:checked + .switch-track::before { transform: translateX(14px); }
.post-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-excerpt p { margin: 0; }
.btn-leer { align-self: flex-start; font-size: 12px; font-weight: 500; color: #1156b8; }
.btn-leer:hover { text-decoration: underline; }
.back-link:hover { color: #141f31; }
.btn-outline { background: #fff; color: #141f31; border: 1px solid #e5e5e5; }
.btn-outline:hover { background: #f5f5f5; }
.btn-danger-outline { background: #fff; color: #991b1b; border: 1px solid #fecaca; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field label { font-size: 12px; font-weight: 600; color: #525252; }
.form-field select:focus, .form-field input:focus, .form-field textarea:focus { outline: none; border-color: #141f31; }
.form-field.grow { flex: 1; min-width: 280px; }
.form-hint { font-size: 11px; color: #6b6b6b; }
.progress-msg.ok { color: #166534; }
.progress-msg.warn { color: #92400e; }
.progress-msg.running { color: #063b91; }
.log-line { padding: 2px 0; color: #d4d4d4; white-space: pre-wrap; word-break: break-word; }
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sidebar.collapsed { width: 0; overflow: hidden; border-right: none; }
.filters-toolbar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.toolbar-group { display: flex; flex-direction: column; gap: 6px; }
.toolbar-group-grow { flex: 1; min-width: 200px; }
.toolbar-group-label { font-size: 10px; color: #6b6b6b; text-transform: uppercase; letter-spacing: 0.05em; }
.filter-chip.active { background: #141f31; color: #fff; }
.filter-chip.active .chip-count { background: rgba(255,255,255,0.2); color: #fff; }
.chip-count { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: #e5e5e5; color: #6b6b6b; flex-shrink: 0; }
.status-chip { padding: 6px 10px; border-radius: 8px; border: 1px solid #e5e5e5; background: none; cursor: pointer; font-size: 12px; color: #525252; text-align: center; transition: all 0.1s; white-space: nowrap; }
.status-chip.active { border-color: #141f31; background: #141f31; color: #fff; }
.status-chip:hover:not(.active) { background: #f5f5f5; }
.fav-star:hover { color: #f59e0b; }
.fav-star.active { color: #f59e0b; }
.fav-star-inline:hover { background: #f5f5f5; }
.fav-star-inline.active { color: #f59e0b; border-color: #fde68a; background: #fffbeb; }
.btn-dl:hover { background: #2c3546; }
.btn-dl:disabled { background: #d9d9d9; cursor: not-allowed; }
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 #e5e5e5; margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tab-btn { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: none; background: none; cursor: pointer; font-size: 13px; font-weight: 500; color: #525252; border-bottom: 2px solid transparent; flex: none; white-space: nowrap; }
.tab-btn:hover { color: #141f31; }
.tab-btn.active { color: #141f31; border-bottom-color: #141f31; }
.channel-nav { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; }
.filter-checkbox-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #525252; cursor: pointer; white-space: nowrap; height: 30px; }
.filter-checkbox-row input { cursor: pointer; }
.channel-btn { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; border: none; background: #f5f5f5; cursor: pointer; font-size: 13px; font-weight: 500; color: #525252; text-align: left; transition: background 0.1s; white-space: nowrap; }
.channel-btn:hover { background: #f0f0f0; color: #141f31; }
.channel-btn.active { background: #141f31; color: #fff; }
.channel-btn.active .ch-badge { background: rgba(255,255,255,0.2); color: #fff; }
.ch-badge { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #e5e5e5; color: #6b6b6b; }
.fav-star { position: absolute; top: 6px; right: 6px; z-index: 2; width: 32px; height: 32px; border: none; border-radius: 50%; background: rgba(255,255,255,0.92); color: #6b6b6b; font-size: 19px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stat { background: #fafafa; border-radius: 8px; padding: 10px 12px; }
.stat-label { font-size: 10px; color: #6b6b6b; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.stat-value { font-size: 15px; font-weight: 600; color: #141f31; }
.version-item { border: 1px solid #f0f0f0; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.version-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.version-date { font-size: 11px; color: #6b6b6b; }
.change-pill { font-size: 10px; padding: 2px 7px; border-radius: 8px; background: #fef3c7; color: #92400e; }
.sin-cambios-badge { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #6b6b6b; background: #f5f5f5; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.toggle-versions:hover { color: #141f31; }
.toggle-versions .chevron { transition: transform 0.15s; font-size: 12px; }
.toggle-versions.open .chevron { transform: rotate(90deg); }
.historial-empty { font-size: 12px; color: #6b6b6b; padding-top: 14px; margin-top: 4px; border-top: 1px solid #f0f0f0; }
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 300; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 8px; }
.lightbox-close { position: fixed; top: 20px; right: 24px; color: #fff; font-size: 28px; cursor: pointer; }
.results-meta b { color: #525252; }
.panel-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 200; }
.panel-overlay.open { display: block; }
.panel-header { padding: 16px 18px; border-bottom: 1px solid #e5e5e5; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: sticky; top: 0; background: #fff; z-index: 1; }
.panel-title { font-size: 15px; font-weight: 600; color: #141f31; line-height: 1.4; }
.panel-close { border: none; background: none; color: #6b6b6b; cursor: pointer; font-size: 18px; flex-shrink: 0; }
.panel-close:hover { color: #141f31; }
.panel-body { padding: 18px; }
.p-field { margin-bottom: 14px; }
.p-field-label { font-size: 10px; color: #6b6b6b; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.p-field-value { font-size: 13px; color: #141f31; line-height: 1.6; }
.p-divider { border: none; border-top: 1px solid #f0f0f0; margin: 16px 0; }
.filter-date:focus { outline: none; border-color: #141f31; }
.filter-row-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #6b6b6b; white-space: nowrap; }
.tab-btn .icon { font-size: 15px; }
.platform-block { background: #fff; border: 1px solid #e5e5e5; border-radius: 12px; padding: 20px; margin-bottom: 24px; }
.platform-block.tab-hidden { display: none; }
.platform-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.platform-head .icon { width: 30px; height: 30px; border-radius: 8px; background: #f0f9ff; color: #1156b8; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.platform-head h2 { font-size: 16px; }
.platform-block .subtitle { margin-bottom: 16px; }
.op-card p { font-size: 12px; color: #525252; max-width: 460px; }
.badge-run { background: #c7e8ff; color: #063b91; }
.fuentes-search { padding: 6px 10px; border: 1px solid #e5e5e5; border-radius: 8px; font-size: 13px; width: 240px; }
.fuentes-search:focus { outline: none; border-color: #141f31; }
.fuentes-wrap { max-height: 380px; overflow-y: auto; border: 1px solid #f0f0f0; border-radius: 8px; }
.fuentes-wrap table { margin: 0; }
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 12px; max-width: 640px; width: 100%; max-height: 85vh; overflow-y: auto; }
.modal-header h3 { font-size: 15px; }
.modal-body { padding: 20px; }
.detalle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.detalle-stat { background: #fafafa; border: 1px solid #f0f0f0; border-radius: 8px; padding: 10px; text-align: center; }
.detalle-stat .n { font-size: 18px; font-weight: 700; }
.detalle-stat .lbl { font-size: 10px; color: #6b6b6b; text-transform: uppercase; margin-top: 2px; }
.log-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(20,31,49,0.5); z-index: 200; align-items: center; justify-content: center; padding: 20px; }
.log-modal-overlay.open { display: flex; }
.log-modal { background: #fff; border-radius: 12px; padding: 20px; width: 100%; max-width: 900px; max-height: 85vh; display: flex; flex-direction: column; }
.log-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.log-modal-head h3 { font-size: 14px; }
.log-modal .log-box { flex: 1; max-height: none; }
.pill:hover { border-color: #a3a3a3; color: #141f31; }
.pill.active { background: #141f31; color: #fff; border-color: #141f31; }
.detalle-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.pills { display: flex; gap: 4px; }
.pill { padding: 5px 12px; border-radius: 999px; font-size: 12px; border: 1px solid #e5e5e5; cursor: pointer; background: #fff; color: #525252; transition: all 0.1s; }
.titulos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.titulo-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 14px; display: flex; flex-direction: column; }
.titulo-thumb { width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: top; border-radius: 6px; margin-bottom: 10px; background: #f5f5f5; border: 1px solid #e5e5e5; }
.titulo-nombre { font-size: 13px; font-weight: 600; color: #141f31; line-height: 1.4; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.titulo-meta { font-size: 11px; color: #6b6b6b; margin-bottom: 12px; line-height: 1.5; }
.titulo-meta b { color: #525252; font-weight: 500; }
.titulo-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.titulo-actions .btn-sm { flex: 1; text-align: center; }
.btn-sm-primary { color: #1156b8; border-color: #c7e8ff; }
.btn-sm-primary:hover { background: #f0f9ff; }
.diff-box { border: 1px solid #e5e5e5; border-radius: 8px; overflow: hidden; overflow-x: auto; }
.diff-line { font-size: 11px; font-family: var(--font-mono); padding: 2px 10px; white-space: pre-wrap; color: #525252; }
.diff-meta { color: #6b6b6b; }
.diff-hunk { background: #f0f9ff; color: #1156b8; }
.diff-add { background: #f0fdf4; color: #166534; }
.diff-rem { background: #fef2f2; color: #991b1b; }

/* Estrella rellena de Tabler (favorito activo). La fuente de iconos solo trae la de contorno (ti-star);
   la rellena va en otra hoja con su propia fuente y, por un solo icono, se dibuja aquí como máscara.
   Toma el color del texto, como el resto de iconos. */
.ti-star-filled { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.243 7.34l-6.38 .925l-.113 .023a1 1 0 0 0 -.44 1.684l4.622 4.499l-1.09 6.355l-.013 .11a1 1 0 0 0 1.464 .944l5.706 -3l5.693 3l.1 .046a1 1 0 0 0 1.352 -1.1l-1.091 -6.355l4.624 -4.5l.078 -.085a1 1 0 0 0 -.633 -1.62l-6.38 -.926l-2.852 -5.78a1 1 0 0 0 -1.794 0l-2.853 5.78z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.243 7.34l-6.38 .925l-.113 .023a1 1 0 0 0 -.44 1.684l4.622 4.499l-1.09 6.355l-.013 .11a1 1 0 0 0 1.464 .944l5.706 -3l5.693 3l.1 .046a1 1 0 0 0 1.352 -1.1l-1.091 -6.355l4.624 -4.5l.078 -.085a1 1 0 0 0 -.633 -1.62l-6.38 -.926l-2.852 -5.78a1 1 0 0 0 -1.794 0l-2.853 5.78z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Móvil. Las barras de pestañas se desplazan en horizontal (sin barra de desplazamiento visible) y el
   foco queda dentro de la pestaña, que la barra recorta por arriba y por abajo. Por debajo de 600 px,
   pestañas más estrechas y campos sin ancho mínimo, para que nada se salga de la pantalla. */
.account-tabs::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.account-tab:focus-visible, .tab-btn:focus-visible { outline: 2px solid #1156b8; outline-offset: -2px; }
@media (max-width: 600px) {
  .account-tab { padding-left: 10px; padding-right: 10px; }
  .form-field.grow { min-width: 0; }
}
