
:root{--bg:#061421;--panel:#062c4d;--line:#0c6ba5;--text:#f7fbff;--meal:#ffb703}
*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden}
body{background:radial-gradient(circle at 50% 20%,#073a61 0,#061a2c 43%,#05111e 100%);color:var(--text);font-family:Arial,Helvetica,sans-serif}
header{height:13vh;min-height:92px;display:flex;align-items:center;padding:5px 1.3vw;border-bottom:1px solid #0c5f92;background:linear-gradient(90deg,#07375f,#062747)}
.logo{width:18vw;max-width:330px;height:12vh;object-fit:contain;object-position:left center}
.divider{height:9vh;border-left:2px solid #dbe9f4;margin:0 2vw 0 .5vw}
.title h1{font-size:clamp(32px,3.1vw,58px);line-height:.95;margin:0;font-weight:900;letter-spacing:.02em}
.title div{font-size:clamp(17px,1.6vw,29px);font-weight:800;color:#b8c9dc;margin-top:.5vh}
.clock{margin-left:auto;text-align:right;font-weight:900;white-space:nowrap}.clock #date{font-size:clamp(17px,1.5vw,27px)}.clock #time{font-size:clamp(38px,4vw,68px);line-height:1}
.dashboard{height:87vh;display:grid;grid-template-columns:minmax(0,1fr) 17.5vw;gap:.8vw;padding:.9vh .9vw 1vh}
#grid{min-width:0;height:100%;display:flex;flex-direction:column;gap:.65vh}
.grade-row{flex:1;min-height:0;display:grid;grid-template-columns:7.3vw repeat(4,minmax(0,1fr));gap:.7vw}
.grade-label{border-radius:12px;display:flex;align-items:center;justify-content:center;text-align:center;font-weight:1000;font-size:clamp(20px,2vw,38px);line-height:1.05;padding:.3vh .3vw;color:#fff;box-shadow:inset 0 0 0 2px #ffffff12}
.grade-label small{display:block;font-size:.48em;margin-top:.3vh}.gl1{background:#ef2f67}.gl2{background:#128ff0}.gl3{background:#05b94d}.gl4{background:#ffc400;color:#092247}.gl5{background:#7344e8}.gle{background:#10aec3}
.card{min-width:0;min-height:0;border-radius:12px;padding:.7vh 1vw;color:#071b35;border:3px solid transparent;box-shadow:0 2px 8px #0005;display:flex;flex-direction:column;justify-content:center;overflow:hidden}
.grade-1{background:#ffd2e0;border-color:#ff3f7a}.grade-2{background:#cdeaff;border-color:#168ff0}.grade-3{background:#cff7d6;border-color:#21c765}.grade-4{background:#fff0b7;border-color:#f5b800}.grade-5{background:#dfceff;border-color:#8056ef}.grade-especial{background:#c9fbfb;border-color:#17cbd0}.grade-outro{background:#dce5ee;border-color:#7c91a5}
.card.empty{visibility:hidden}.turma,.prof-name{font-size:clamp(17px,1.55vw,28px);font-weight:1000;line-height:1}.turma-small{font-size:clamp(16px,1.35vw,24px);font-weight:900;margin-top:.25vh}.componente{font-size:clamp(13px,1.05vw,19px);font-weight:800;margin-top:.3vh;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.prof{font-size:clamp(12px,.95vw,17px);margin-top:.2vh;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.period{font-size:clamp(10px,.78vw,14px);margin-top:.35vh;font-weight:800;color:#173652}
.sub{display:inline-block;background:#d7263d;color:white;border-radius:6px;padding:2px 5px;font-size:10px;font-weight:900;margin-left:4px}
.meal{background:linear-gradient(135deg,#ffe36a,#ffad22)!important;border-color:#fff1a1!important;box-shadow:0 0 0 2px #ffb703,0 0 18px #ffb70399;color:#3a2400}.meal-label{font-size:clamp(18px,1.45vw,27px);font-weight:1000}
#side{height:100%;display:flex;flex-direction:column;gap:.8vh;min-width:0}.sidebox{border:2px solid #0874b5;border-radius:12px;background:linear-gradient(145deg,#06345a,#06243e);padding:.8vh .8vw;overflow:hidden}.sidebox h2{font-size:clamp(13px,1.1vw,20px);margin:0 0 .55vh;font-weight:1000}.sidebox:first-child{flex:1.65}.legend{flex:1}.mealbox{flex:.65;border-color:#e9b400;background:linear-gradient(145deg,#4a3a05,#1f220f)}.mealbox h2{color:#ffd21b}
.event{display:grid;grid-template-columns:3.4vw 1fr;gap:.4vw;border-bottom:1px solid #17608d;padding:.45vh 0;align-items:start}.event:last-child{border-bottom:0}.event-time{font-weight:1000;font-size:clamp(12px,.95vw,17px)}.event-text{font-size:clamp(10px,.78vw,14px);line-height:1.2}.event-text b{display:block}.legend div{font-size:clamp(11px,.85vw,16px);display:flex;align-items:center;gap:.55vw;margin:.35vh 0}.legend i{width:1.55vw;height:1.55vw;min-width:16px;min-height:16px;border-radius:50%;display:inline-block;border:2px solid}.c1{background:#ffd2e0;border-color:#ff3f7a!important}.c2{background:#cdeaff;border-color:#168ff0!important}.c3{background:#cff7d6;border-color:#21c765!important}.c4{background:#fff0b7;border-color:#f5b800!important}.c5{background:#dfceff;border-color:#8056ef!important}.ce{background:#c9fbfb;border-color:#17cbd0!important}
.meal-help{display:flex;gap:.6vw;align-items:center;font-size:clamp(10px,.78vw,14px);line-height:1.2}.meal-help:first-letter{font-size:28px}
.waiting{height:100%;display:flex;align-items:center;justify-content:center;font-size:clamp(28px,4vw,65px);font-weight:900}.waiting span{font-size:.55em;margin-left:10px}
@media(max-width:1200px){.dashboard{grid-template-columns:minmax(0,1fr) 20vw}.grade-row{grid-template-columns:8vw repeat(4,minmax(0,1fr))}.logo{width:20vw}}

/* V5.1 — ajustes de leitura para TV */
header{height:14vh;min-height:100px;padding:.35vh 1.1vw}
.logo{width:22vw;max-width:410px;height:13.2vh}
.divider{height:10vh;margin:0 2vw 0 .7vw}
.title h1{font-size:clamp(40px,4vw,72px);line-height:1;font-weight:1000}
.dashboard{height:86vh;padding:.65vh .9vw .8vh}
#grid{gap:.48vh}
.grade-row{gap:.65vw}
.grade-label{font-size:clamp(22px,2.15vw,40px);padding:.15vh .2vw}
.grade-label small{font-size:.43em;line-height:1.05;margin-top:.15vh}
.card{padding:.45vh 1.05vw}
.turma,.prof-name{font-size:clamp(20px,1.72vw,31px)}
.turma-small{font-size:clamp(18px,1.5vw,27px)}
.componente{font-size:clamp(15px,1.16vw,21px);margin-top:.2vh}
.prof{font-size:clamp(14px,1.03vw,19px);margin-top:.12vh}
.period{font-size:clamp(11px,.84vw,15px);margin-top:.2vh}


/* V5.2 — TURMAS com coluna; PROFESSORES em ordem alfabética sem coluna */
.grade-label.gle{
  flex-direction:column;
  gap:0;
  line-height:.92;
  white-space:normal;
  overflow:hidden;
}
.grade-label.gle span{
  display:block;
  width:100%;
  font-size:clamp(14px,1.22vw,23px);
  letter-spacing:-.02em;
  text-align:center;
}
.professores-grid{
  height:100%;
  min-width:0;
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-auto-rows:minmax(0,1fr);
  gap:.65vw;
  align-content:stretch;
}
.professores-grid .professor-card{
  height:100%;
  padding:.65vh 1vw;
  justify-content:center;
}
.professores-grid .prof-name{font-size:clamp(18px,1.55vw,29px)}
.professores-grid .turma-small{font-size:clamp(16px,1.25vw,23px)}
.professores-grid .componente{font-size:clamp(13px,1vw,19px)}
@media(max-width:1200px){
  .professores-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .grade-label.gle span{font-size:clamp(12px,1.15vw,19px)}
}


/* V5.3 — logo CAIC maior no cabeçalho
   Mantém o restante do layout V5.2 inalterado. */
header{
  position:relative;
  overflow:visible;
}
.logo{
  width:22vw;
  max-width:none;
  height:13.4vh;
  object-fit:contain;
  object-position:left center;
  transform:scale(1.55);
  transform-origin:left center;
  position:relative;
  z-index:2;
  margin-right:5.8vw;
}
.divider{
  position:relative;
  z-index:3;
  margin-left:.2vw;
}
@media(max-width:1200px){
  .logo{
    width:22vw;
    height:13.4vh;
    transform:scale(1.45);
    margin-right:5vw;
  }
}


/* V5.4 — ajustes finais do visor */
.logo{
  left:113px !important; /* aproximadamente 3 cm para a direita */
}

/* Próximos eventos: passado / atual / futuro */
.evento-passado{
  opacity:.38 !important;
  filter:grayscale(.45);
  text-shadow:0 2px 5px rgba(0,0,0,.7);
}
.evento-passado::before{
  content:"✓";
  margin-right:.45em;
  font-weight:900;
}
.evento-atual{
  opacity:1 !important;
  box-shadow:inset 3px 0 0 #ffd21a, 0 0 10px rgba(255,210,26,.22);
  font-weight:800;
}

/* V5.5 */
.meal-icons{font-size:clamp(18px,1.35vw,27px);white-space:nowrap}.event.evento-passado{opacity:.38;filter:grayscale(.45)}

/* V5.6 — VISOR EM CAIXA ALTA, TIPOGRAFIA MAIOR E EVENTO ATUAL */
body.viewer-page, body.viewer-page * { text-transform: uppercase; }
body.viewer-page .card { font-size: 1.08em; }
body.viewer-page .card .teacher,
body.viewer-page .card .subject { font-size: 1.08em; }
body.viewer-page .event-text,
body.viewer-page .legend,
body.viewer-page .meal-help { font-size: 1.06em; }
.current-event{
  min-height:58vh;display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;font-weight:900;line-height:1.02
}
.current-event-kicker{font-size:clamp(30px,3vw,58px);letter-spacing:.04em;margin-bottom:10px}
.current-event-icon{font-size:clamp(70px,8vw,150px);line-height:1}
.current-event-name{font-size:clamp(54px,6vw,116px);margin-top:4px}
.current-event-group{font-size:clamp(40px,4.5vw,86px);margin-top:10px}
.current-event-time{font-size:clamp(30px,3.2vw,62px);margin-top:16px}


/* V5.9 — correção definitiva da tela TURMAS */
.turmas-grid{
  height:100%;
  min-height:0;
  display:flex !important;
  flex-direction:column;
  gap:.65vh;
}
.turmas-grid .grade-row{
  flex:1 1 0;
  min-height:0;
}
.turmas-grid .card{
  min-height:0;
  overflow:hidden;
}
.current-event{
  width:100%;
  height:100%;
  min-height:0;
  margin:0;
  align-items:center;
  justify-content:center;
  text-align:center;
}
