/* CLEMI · Real Time — pantalla de agenda para televisores y monitores */
:root {
  --fondo: #0B1D14; --fondo2: #10291C; --tarjeta: #15331F; --linea: rgba(232, 194, 91, .16); --linea2: rgba(255, 255, 255, .08);
  --oro: #E8C25B; --oro2: #C6A13B; --texto: #EEF3EF; --suave: #A9BCAF; --ok: #4CC17E; --alerta: #F0B44C; --mal: #EF6B5E; --azul: #6FB3E8;
  --panel: 31vh;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.rt { background: radial-gradient(1200px 600px at 80% -10%, #1C4430 0%, transparent 60%), var(--fondo); color: var(--texto); font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif; overflow: hidden; }
button { font: inherit; }

.rt-cab { display: flex; align-items: center; gap: 18px; padding: 10px 22px; background: linear-gradient(180deg, #0E2a1c, #0B1D14); border-bottom: 2px solid var(--oro2); height: 70px; }
.rt-logo { height: 30px; }
.rt-tit { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.rt-tit b { font-family: Cinzel, serif; font-weight: 600; color: var(--oro); font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-vivo { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 800; color: #fff; display: inline-flex; align-items: center; gap: 7px; }
.rt-vivo i { width: 9px; height: 9px; border-radius: 50%; background: var(--mal); box-shadow: 0 0 0 0 rgba(239,107,94,.7); animation: latido 1.6s infinite; }
@keyframes latido { 0% { box-shadow: 0 0 0 0 rgba(239,107,94,.7); } 70% { box-shadow: 0 0 0 9px rgba(239,107,94,0); } 100% { box-shadow: 0 0 0 0 rgba(239,107,94,0); } }
.rt-semana { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--suave); font-weight: 600; }
.rt-semana span { min-width: 150px; text-align: center; color: var(--texto); }
.rt-semana button { background: transparent; border: 1px solid var(--linea); color: var(--texto); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.rt-semana button:hover { border-color: var(--oro); }
.rt-reloj { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.rt-reloj b { font-size: 1.9rem; font-variant-numeric: tabular-nums; font-weight: 700; color: #fff; }
.rt-reloj b small { font-size: .95rem; color: var(--suave); }
.rt-reloj span { font-size: .8rem; color: var(--oro); }
.rt-btn { background: var(--oro); color: #1b1606; border: 0; border-radius: 9px; padding: 9px 14px; font-weight: 800; cursor: pointer; text-decoration: none; white-space: nowrap; }
.rt-btn.rt-salir { background: transparent; color: var(--suave); border: 1px solid var(--linea); font-weight: 600; }
body.lleno .rt-salir, body.lleno .rt-semana button { display: none; }

/* Cinta superior */
.rt-ticker { display: flex; align-items: stretch; height: 46px; background: #0F2619; border-bottom: 1px solid var(--linea); }
.rt-ticker-et { flex: none; background: var(--oro2); color: #1b1606; font-weight: 800; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; padding: 0 14px; line-height: 1.15; z-index: 2; }
.rt-ticker-via { flex: 1; overflow: hidden; position: relative; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.rt-ticker-cinta { display: flex; width: max-content; height: 100%; align-items: center; animation: cinta 60s linear infinite; }
.rt-tramo { display: flex; align-items: center; white-space: nowrap; }
@keyframes cinta { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.rt-ti { display: inline-flex; align-items: center; gap: 7px; font-size: 1.02rem; padding: 0 6px; }
.rt-ti b { color: var(--oro); }
.rt-ti em { font-style: normal; font-size: .78rem; color: var(--suave); border: 1px solid var(--linea2); border-radius: 999px; padding: 1px 8px; }
.rt-sep { color: var(--oro2); padding: 0 18px; }
.pt { width: 9px; height: 9px; border-radius: 50%; background: var(--azul); display: inline-block; }
.pt.st-en_curso { background: var(--ok); } .pt.st-cerrado { background: var(--suave); } .pt.res { background: transparent; border: 2px dashed var(--oro); }

/* Agenda */
.rt-main { position: absolute; top: 118px; left: 0; right: 0; bottom: calc(var(--panel) + 22px); padding: 12px 18px 0; overflow: auto; }
.rt-main { overflow: hidden; padding-bottom: 10px; }
.rt-agenda { height: 100%; }
.rt-grid { display: grid; grid-template-columns: 130px repeat(7, minmax(0, 1fr)); border: 1px solid var(--linea); border-radius: 12px; overflow: hidden; background: var(--fondo2); height: 100%; }
.rt-c { border-right: 1px solid var(--linea2); border-bottom: 1px solid var(--linea2); padding: 5px; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 4px; }
.rt-c.hoy { background: rgba(232,194,91,.06); }
.rt-h { background: #0D2318; align-items: center; justify-content: center; gap: 1px; padding: 7px 4px; position: sticky; top: 0; z-index: 1; }
.rt-h span { font-size: .78rem; text-transform: capitalize; color: var(--suave); }
.rt-h b { font-family: Cinzel, serif; font-size: 1.35rem; }
.rt-h em { font-style: normal; color: var(--mal); font-size: .68rem; font-weight: 700; }
.rt-h.hoy { background: var(--oro2); } .rt-h.hoy span, .rt-h.hoy b { color: #1b1606; }
.cupo { font-style: normal; font-size: .7rem; font-weight: 800; border-radius: 999px; padding: 0 8px; }
.cupo.libre { background: rgba(76,193,126,.18); color: var(--ok); } .cupo.medio { background: rgba(240,180,76,.2); color: var(--alerta); } .cupo.lleno { background: rgba(239,107,94,.22); color: var(--mal); }
.rt-h.hoy .cupo { background: #1b1606; }
.rt-c-sala { font-weight: 700; justify-content: center; background: #0D2318; color: var(--oro); font-size: .95rem; }
.rt-ev { flex: 1 1 auto; min-height: 0; overflow: hidden; border-radius: 8px; padding: 5px 8px; background: rgba(111,179,232,.14); border-left: 3px solid var(--azul); display: flex; flex-direction: column; gap: 1px; font-size: .82rem; line-height: 1.25; }
.rt-ev b { font-variant-numeric: tabular-nums; font-size: .78rem; }
.rt-ev .t { font-weight: 700; font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rt-ev .e { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-ev .e, .rt-ev .d { color: var(--suave); }
.rt-ev .ya { color: var(--ok); font-weight: 800; }
.rt-ev.st-en_curso { background: rgba(76,193,126,.16); border-left-color: var(--ok); }
.rt-ev.st-cerrado { opacity: .6; border-left-color: var(--suave); }
.rt-ev.rt-res { background: rgba(232,194,91,.08); border: 1.5px dashed rgba(232,194,91,.6); color: var(--oro); }

/* Panel fijo inferior */
.rt-panel { position: fixed; left: 0; right: 0; bottom: 22px; height: var(--panel); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 14px; padding: 12px 18px; background: linear-gradient(180deg, rgba(11,29,20,.92), #0A1911); border-top: 2px solid var(--oro2); }
.rt-panel h2 { margin: 0 0 8px; font-family: Cinzel, serif; color: var(--oro); font-size: 1.05rem; font-weight: 600; }
.rt-panel h2 small { font-family: "Source Sans 3", sans-serif; color: var(--suave); font-size: .8rem; font-weight: 500; margin-left: 8px; }
.rt-hoy, .rt-bit { min-height: 0; display: flex; flex-direction: column; }
.rt-hoy-ev { overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.rt-he { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 12px; padding: 10px 14px; }
.rt-he.st-en_curso { border-color: rgba(76,193,126,.55); }
.rt-he-c { display: flex; flex-direction: column; min-width: 0; }
.rt-he-c b { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-he-c span { color: var(--suave); font-size: .85rem; }
.rt-he-c .est { font-style: normal; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--azul); }
.rt-he.st-en_curso .est { color: var(--ok); }
.rt-he-n { display: flex; gap: 16px; }
.rt-he-n div { display: flex; flex-direction: column; min-width: 86px; }
.rt-he-n small { color: var(--suave); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.rt-he-n b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.rt-he-n b em { font-style: normal; font-size: .9rem; color: var(--suave); }
.bar { height: 5px; border-radius: 99px; background: var(--linea2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); }
.rt-bit-l { list-style: none; margin: 0; padding: 0; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.rt-bit-l li { display: grid; grid-template-columns: 48px 98px minmax(0, 1fr); gap: 10px; align-items: start; padding: 7px 10px; border-radius: 9px; background: rgba(255,255,255,.035); border-left: 3px solid var(--linea); }
.rt-bit-l li.nuevo { animation: entra 1.8s ease-out; }
@keyframes entra { 0% { background: rgba(232,194,91,.35); transform: translateX(-12px); } 100% { background: rgba(255,255,255,.035); transform: none; } }
.rt-bit-l time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--oro); }
.rt-bit-l .tg { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); padding-top: 3px; }
.rt-bit-l p { margin: 0; font-size: .93rem; line-height: 1.3; }
.rt-bit-l p small { display: block; color: var(--suave); font-size: .78rem; }
.rt-bit-l li.tipo-novedad { border-left-color: var(--alerta); } .rt-bit-l li.tipo-asistencia { border-left-color: var(--ok); } .rt-bit-l li.tipo-evento { border-left-color: var(--azul); }
.rt-bit-l li.rt-vacio, .rt-vacio { display: block; color: var(--suave); background: transparent; border: 0; padding: 14px; text-align: center; }
.rt-estado { position: fixed; left: 0; right: 0; bottom: 0; height: 22px; margin: 0; font-size: .74rem; color: var(--ok); text-align: right; padding: 3px 18px; background: #07140D; }
.rt-estado.mal { color: var(--mal); }

@media (max-width: 900px) {
  body.rt { overflow: auto; }
  .rt-cab { flex-wrap: wrap; height: auto; gap: 8px 12px; padding: 10px 16px; }
  .rt-semana { margin-left: 0; order: 5; width: 100%; justify-content: center; }
  .rt-main, .rt-panel { position: static; height: auto; padding: 12px 16px; }
  .rt-main { overflow-x: auto; } .rt-agenda { height: auto; } .rt-grid { min-width: 820px; height: auto; grid-template-rows: none !important; grid-auto-rows: minmax(64px, auto); }
  .rt-panel { grid-template-columns: 1fr; }
  .rt-he { grid-template-columns: 1fr; }
}
.rt-ev > * { flex: none; }
.rt-ensayo { font-size: .72rem; font-weight: 800; letter-spacing: .1em; color: #1b1606; background: var(--alerta); border-radius: 999px; padding: 1px 10px; width: max-content; }

/* Calendario cargado */
.rt-ev.rt-cal { background: rgba(160,145,230,.12); border: 1.5px solid rgba(160,145,230,.6); color: #d9d2ff; }
.rt-ev.rt-cal.pc { border-style: dashed; }
.rt-ti .pt.cal { background: #a091e6; }
.rt-he.rt-he-cal { border-color: rgba(160,145,230,.6); }
/* Varias actividades en la misma casilla: una línea por actividad para que todas se vean. */
.rt-c.multi { gap: 3px; }
.rt-c.multi .rt-ev { flex: 0 1 auto; padding: 2px 7px; }
.rt-c.multi .rt-ev > b, .rt-c.multi .rt-ev .e, .rt-c.multi .rt-ev .d { display: none; }
.rt-c.multi .rt-ev .t { -webkit-line-clamp: 1; font-size: .8rem; }
.rt-c.multi .rt-ev.rt-cal.pc .t::before { content: '? '; color: #a091e6; }

/* ===== Vistas semana / mes / año ===== */
.rt-modos { margin-left: auto; display: inline-flex; border: 1px solid var(--linea); border-radius: 999px; padding: 3px; }
.rt-modos + .rt-semana { margin-left: 0; }
.rt-modos button { background: transparent; border: 0; color: var(--suave); font: inherit; font-weight: 700; font-size: .85rem; padding: 4px 12px; border-radius: 999px; cursor: pointer; }
.rt-modos button.on { background: var(--oro); color: #1b1606; }
body[data-vista="mes"] .rt-semana span, body[data-vista="anio"] .rt-semana span { min-width: 130px; }
/* Mes */
.rtm { height: 100%; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--linea2); border-radius: 12px; overflow: hidden; background: var(--fondo2); }
.rtm-h { text-align: center; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); padding: 6px 0; background: #0D2318; border-bottom: 1px solid var(--linea2); }
.rtm-d { border-right: 1px solid var(--linea2); border-bottom: 1px solid var(--linea2); padding: 4px 6px; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.rtm-d:nth-child(7n) { border-right: 0; }
.rtm-d.fuera { opacity: .4; }
.rtm-d.hoy { background: rgba(232,194,91,.1); box-shadow: inset 0 0 0 2px var(--oro2); }
.rtm-d.lleno { background-image: repeating-linear-gradient(135deg, rgba(239,107,94,.07) 0 8px, transparent 8px 16px); }
.rtm-c { display: flex; align-items: center; gap: 6px; flex: none; }
.rtm-c b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.rtm-d.hoy .rtm-c b { color: var(--oro); }
.rtm-c em { font-style: normal; font-size: .66rem; color: var(--mal); font-weight: 700; }
.rtm-c .cupo { margin-left: auto; }
.rtm-it { flex: none; font-size: .76rem; line-height: 1.3; padding: 1px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(111,179,232,.14); border-left: 3px solid var(--azul); }
.rtm-it b { color: var(--oro); font-weight: 800; }
.rtm-it.st-en_curso { background: rgba(76,193,126,.16); border-left-color: var(--ok); }
.rtm-it.res { background: rgba(232,194,91,.08); border-left: 3px dashed var(--oro2); color: var(--oro); }
.rtm-it.cal { background: rgba(160,145,230,.14); border-left-color: #a091e6; color: #e1dbff; }
.rtm-it.cal.pc { border-left-style: dashed; }
.rtm-mas { font-size: .72rem; color: var(--suave); font-weight: 700; padding-left: 6px; flex: none; }
/* Año */
.rta { height: calc(100% - 26px); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rta-m { background: var(--fondo2); border: 1px solid var(--linea2); border-radius: 12px; padding: 8px 10px; min-height: 0; display: flex; flex-direction: column; }
.rta-m.actual { border-color: var(--oro2); }
.rta-t { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.rta-t b { font-family: Cinzel, serif; color: var(--oro); font-size: 1rem; }
.rta-t small { color: var(--suave); font-size: .72rem; font-weight: 600; }
.rta-g { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 2px; }
.rta-s { text-align: center; font-size: .62rem; font-weight: 700; color: var(--suave); }
.rta-d { display: flex; align-items: center; justify-content: center; border-radius: 5px; font-size: .74rem; font-variant-numeric: tabular-nums; color: var(--suave); }
.rta-d.o1 { background: rgba(160,145,230,.35); color: #fff; font-weight: 700; }
.rta-d.o2 { background: #8a78dc; color: #fff; font-weight: 800; }
.rta-d.fe { color: var(--mal); }
.rta-d.o2.fe, .rta-d.o1.fe { color: #ffd9d4; }
.rta-d.hoy { box-shadow: inset 0 0 0 2px var(--oro); color: var(--oro); }
.rta-ley { display: flex; gap: 18px; justify-content: flex-end; font-size: .78rem; color: var(--suave); margin-top: 6px; height: 20px; align-items: center; }
.rta-ley i { display: inline-flex; width: 16px; height: 16px; vertical-align: middle; margin-right: 4px; font-style: normal; font-size: .66rem; }

/* ===== Todo el texto visible (sin «…») y letra que se ajusta a la pantalla ===== */
.rt-agenda { --rtz: 1; display: flex; flex-direction: column; }
.rt-agenda > .rt-grid, .rt-agenda > .rtm, .rt-agenda > .rta { flex: 1; min-height: 0; height: auto; }
.rt-ev { font-size: calc(.82rem * var(--rtz)); }
.rt-ev b { font-size: calc(.78rem * var(--rtz)); }
.rt-ev .t { font-size: calc(.88rem * var(--rtz)); display: block; -webkit-line-clamp: unset; overflow: visible; }
.rt-ev .e { white-space: normal; }
.rt-ev { overflow: visible; flex: none; }
.rt-c.multi .rt-ev { flex: none; }
.rt-c.multi .rt-ev .t { -webkit-line-clamp: unset; font-size: calc(.8rem * var(--rtz)); }
.rtm-it { white-space: normal; overflow: visible; text-overflow: clip; font-size: calc(.76rem * var(--rtz)); }
.rtm-c b { font-size: calc(1rem * var(--rtz)); }
.rt-agenda.desborda .rt-c, .rt-agenda.desborda .rtm-d { overflow-y: auto; }
/* Año: colores según el cupo */
.rta-d.o1 { background: rgba(240,180,76,.55); color: #1b1606; font-weight: 700; }
.rta-d.o2 { background: #b3473d; color: #fff; font-weight: 800; }
.rta-d.o3 { background: #ff7b6e; color: #2a0703; font-weight: 800; box-shadow: inset 0 0 0 2px #ffd0ca; }
.rta { height: auto; }
/* Leyenda */
.rt-ley { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 14px; font-size: .74rem; color: var(--suave); padding: 6px 2px 0; }
.rt-ley.arriba { padding: 0 2px 6px; }
.rt-ley span { display: inline-flex; align-items: center; gap: 5px; }
.rt-ley .sep { width: 1px; height: 14px; background: var(--linea2); }
.rt-ley i { display: inline-flex; align-items: center; justify-content: center; font-style: normal; }
.rt-ley .lm { width: 18px; height: 12px; border-radius: 3px; }
.rt-ley .lm.ev { background: rgba(111,179,232,.3); border-left: 3px solid var(--azul); }
.rt-ley .lm.cur { background: rgba(76,193,126,.3); border-left: 3px solid var(--ok); }
.rt-ley .lm.res { background: rgba(232,194,91,.12); border: 1.5px dashed var(--oro); }
.rt-ley .lm.cal { background: rgba(160,145,230,.25); border: 1.5px solid #a091e6; }
.rt-ley .lm.cal.pc { border-style: dashed; }
.rt-ley .rta-d { width: 16px; height: 16px; border: 1px solid var(--linea2); }
.rt-ley .cupo { font-size: .7rem; }
body.compacto { --panel: 21vh; }
