/* =========================================================
   SMART PANEL (TV) — CSS ÚNICO
   Mantém o design antigo e casa com o HTML atual
   ========================================================= */

/* Variáveis removidas — valores inlined para simplicidade */


  *,
  *::before,
  *::after { box-sizing: border-box; }
  
  html, body{
    margin: 0;
    height: 100%;
    overflow: hidden;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    color: #fff;
  }
  
  /* Tema azul (igual ao antigo) */
  .theme-blue { background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%); }
  
  /* ===== Shell ===== */
  .panel{
    display: flex;
    flex-direction: column;
    max-width: 95vw;
    margin: 0 auto;
    height: 92vh;
    justify-content: space-around;
  }
  
  /* ===== Header ===== */
  .hdr{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.8vh 2.4vh;
    /* sem linha de separação — mock não tem borda extra */
    background: rgba(0,0,0,.20);
    backdrop-filter: blur(.4vh);
    border-radius: 1.6vh;
  }
  .hdr .brand{ display:flex; align-items:center;}
  .hdr .brand-logo{ width:5.2vh; height:5.2vh; object-fit:contain; display:none; }
  .hdr .brand-names{ display:flex; flex-direction:column; }
  .hdr .brand-title{ font-size:2.3vh; font-weight:800; line-height:1; }
  .hdr .brand-sub{   font-size:1.5vh; opacity:.8; margin-top:.4vh; }
  
  .hdr .timebox{ text-align:right; }
  .hdr .timebox .clock{ font-family: ui-monospace, Menlo, Consolas, monospace; font-size:2.3vh; }
  .hdr .timebox .sub{ font-size:1.5vh; opacity:.8; }

  .hdr .env-badge[hidden]{ display:none !important; }
  .hdr .env-badge{
    margin-left: 1.2vh;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    font-size: 1.35vh;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.4vh 0.95vh;
    border-radius: 0.55vh;
    border: 0.15vh solid rgba(255,255,255,0.35);
    box-shadow: 0 0.2vh 0.55vh rgba(0,0,0,0.2);
  }
  .hdr .env-badge--train{
    background: linear-gradient(180deg, #b45309, #92400e);
    color: #fffbeb;
  }
  .hdr .env-badge--local{
    background: linear-gradient(180deg, #0369a1, #0c4a6e);
    color: #e0f2fe;
  }
  
  /* Mostrar brasão quando houver URL */
  .show-logo .hdr .brand-logo{ display:block; }
  
  /* ===== Hero (cartão principal) ===== */
  .hero{
    border-radius: calc(2.2vh + .6vh);
    background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.06));
    backdrop-filter: blur(.5vh);
    padding: 2vh 2.2vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 40vh;
  }
  .hero .hero-title{
    text-align:center;
    font-size: 2.4vh;
    font-weight: 800;
  }
  .hero .person-content{
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
  }
  .hero .person{
    text-align:center;
    white-space: nowrap;
    font-size: 8.5vh;
    font-weight: 900;
    color:#fde047;                     /* amarelo do layout */
    line-height: 1.1;
    text-shadow: 0 .2vh .2vh rgba(0,0,0,.18);
    max-width: 30ch;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hero .ticket{
    text-align:center;
    font-size: 4vh;
    font-weight: 800;
    opacity:.98;
  }
  
  /* Linha de informações (LOCAL / CHAMADAS) */
  .info-row{
    margin-top: auto;
    display:flex;
    justify-content: space-between;
    width: 100%;
  }
  
  /* Pílulas padrão */
  .pill{
    background: rgba(255,255,255,.17);
    border-radius: 2vh;
    padding: 2.0vh 1.8vh;
    width: 49.5%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
  }
  .pill .pill-label{
    font-size: 2.7vh;
    opacity:.78;
  }
  .pill .pill-value{
    font-size: 2.65vh;   /* valor dentro das pills conforme mock */
    font-weight: 800;
    margin-top:.7vh;
    text-align: center;
  }
  
  /* Pílula do LOCAL com aro amarelo igual à tela antiga */
  #desk-card{
    border-color: #fbbf24 !important;
    box-shadow: inset 0 0 0 .18vh rgba(251,191,36,.85);
  }
  
  /* KPI (Chamadas) com senha integrada */
  .kpi{
    background: rgba(255,255,255,.16);
    border-radius: 2.2vh;
    padding: 2.0vh 1.8vh;
    width: 49.5%;
    display:flex; 
    align-items:center; 
    justify-content:center;
    flex-direction: column;
    gap: 0.8vh;
  }
  .kpi .kpi-label{ text-transform:uppercase; font-size:1.7vh;  opacity:.78; }
  .kpi .kpi-value{ font-size:2.8vh; font-weight:900; }
  
  /* Senha grande dentro do card de Chamadas */
  .kpi-ticket {
    font-size: 5.5vh;
    font-weight: 900;
    color: #fde047;
    text-shadow: 0 0.15vh 0.15vh rgba(0,0,0,0.2);
    line-height: 1;
  }
  .kpi-calls-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3vh;
  }
  
  /* ===== Grid inferior (sempre 2 colunas) ===== */
  .panel-columns{
    display:flex;
    max-height: 40vh;
    justify-content: space-between;
  }
  .panel-columns > .card:first-child{
    width: 62%;
  }
  .panel-columns > .card:last-child{
    width: 36%;
  }
  .card{
    display:flex;
    flex-direction:column;
    background: rgba(255,255,255,.12);
    border-radius: 2.2vh;
    padding: 2vh 2.2vh;
    backdrop-filter: blur(.4vh);
    height: 36vh;
  }
  .card .card-title{
    display:flex; align-items:center; justify-content:center;
    font-size: 1.8vh;
    font-weight: 800;
    opacity:.9;
    margin-bottom: 2.0vh;
  }
  .card .card-body{
    height: 100%;
    overflow: hidden;
    display:flex; 
    flex-direction:column; 
    justify-content: start;
    gap: 2vh;
  }

  /* Grid 2 colunas para próximas senhas */
  .next-grid{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2vh;
  }
  
  /* Linhas das listas */
  .list-item{
    display:flex; align-items:center; justify-content:space-between;
    background: rgba(255,255,255,.15);
    border-radius: 1.6vh;
    padding: 1.55vh 1.6vh;
  }
  .list-item .left{ display:flex; align-items:center; }
  
  .badge-num{
    margin-right: 1vh;
    width: 3.2vh; height: 3.2vh; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    background:#3b82f6; color:#fff;
    font-weight:900; font-size:1.6vh;
  }
  
  .dot{ width:1.2vh; height:1.2vh; border-radius:50%; margin-right: 1vh;}
  .dot.green{  background:#4ade80; }
  .dot.blue{   background:#60a5fa; }
  .dot.yellow{ background:#facc15; }
  .dot.purple{ background:#c4b5fd; }
  
  .li-title{ font-size:1.9vh; font-weight:800; line-height:1.05; }
  .li-sub {
    font-size: 1.5vh;
    opacity: .72;
    overflow: hidden;
    height: 2vh;
    width: 100%;
    white-space: nowrap;  
}
  .li-right{ text-align:right; font-size:1.35vh; opacity:.65; }
  
  /* Estados vazios */
  .empty{
    text-align:center;
    opacity:.72;
    margin-top: 6vh;
    font-size: 2.0vh;
  }
  .section-footer {
    display: none;
    background-color: #0c1838;
    border-top: 1px solid #2c4da1;
    min-height: 6.5vh;
    max-height: 10vh;
    width: 100vw;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    box-sizing: border-box;
    padding: 1vh 2.4vw;
  }
  
  .footer-message {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    overflow: hidden;
  }
  
  .footer-message-text {
    text-align: center;
    width: 100%;
    max-width: 100vw;
  }

  .footer-message-text p {
    margin: 0;
    font-size: 2.5vh;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    white-space: nowrap;
    overflow: visible;
  }

  /* ===== Marquee (somente painel principal) ===== */
  .footer-message-text p.footer-marquee {
    display: inline-block;
    will-change: transform;
    animation-name: footerMarquee;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    padding-left: 0;
    padding-right: 0;
  }

  @keyframes footerMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
  }
  
  
  /* ===== Efeitos que o JS usa ===== */
  .pulse-notification{ animation: pulse 3s infinite ease-in-out; }
  @keyframes pulse{
    0%,100%{ box-shadow: 0 0 0 0 rgba(255,255,255,0); }
    50%    { box-shadow: 0 0 0 .8vh rgba(59,130,246,.14); }
  }
  .zoom-in{ animation: zoom .25s ease-out; }
  @keyframes zoom{ from{ transform:scale(.97); opacity:.85 } to{ transform:scale(1); opacity:1 } }
  /* Piscar do nome quando a senha é chamada (JS adiciona .person-name-blink) */
  .person-name-blink{ animation: nameBlink .8s ease-in-out 8; }
  @keyframes nameBlink{ 0%,100%{ opacity:1 } 50%{ opacity:.55 } }
  
  .ticket-called-highlight{ border-color:#fff !important; }
  .desk-card-highlight{ border-color:#fbbf24 !important; }

  /* ===== Layout compacto (TV distante / visibilidade) ===== */
  /* O <body> é o .panel — não existe .panel filho; sem isso o flex não preenchia a altura */
  body.panel.panel-compact {
    height: 96vh;
    min-height: 0;
    justify-content: flex-start;
    max-width: 98vw;
  }
  body.panel-compact .hdr {
    flex-shrink: 0;
    padding: 1vh 1.2vh;
  }
  body.panel-compact .hdr .brand-title { font-size: 2vh; }
  body.panel-compact .hdr .brand-sub { font-size: 1.35vh; }
  body.panel-compact .hdr .env-badge { font-size: 1.12vh; padding: 0.28vh 0.7vh; margin-left: 0.85vh; }
  body.panel-compact .hdr .timebox .clock { font-size: 2vh; }
  /* `welcome-info` deve aparecer só quando estiver aguardando (JS controla) */
  /* Esconde a senha antiga fora do card (se existir por JS) */
  body.panel-compact .hero .ticket {
    display: none !important;
  }
  /* Hero ocupa todo o espaço entre cabeçalho e faixa inferior (sem “faixa vazia”) */
  body.panel-compact .hero {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    max-height: 60vh;
    padding: 0.8vh 0.95vh;
    justify-content: flex-start;
    align-items: stretch;
  }
  body.panel-compact .hero .panel-main-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    align-items: center;
  }
  body.panel-compact .hero .person-content {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    gap: 0.4vh;
    padding-top: 0.2vh;
    overflow: hidden;
  }
  /* Local + Chamadas colados na base do bloco principal quando visível */
  body.panel-compact .hero #ticket-info {
    margin-top: auto;
    width: 100%;
    padding-bottom: 0.25vh;
  }
  body.panel-compact .hero .hero-title {
    font-size: 3vh;
    font-weight: 900;
    flex-shrink: 0;
  }
  /* Nome da pessoa: ajustado para não ocupar tanto espaço vertical */
  body.panel-compact .hero .person {
    font-size: 13vh;
    max-width: 98vw;
    line-height: 1.05;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
  }
  body.panel-compact .hero .person.scroll-name{
    animation: scrollNameLeftReturn 16s linear infinite;
  }
  @keyframes scrollNameLeftReturn {
    0%, 18% { transform: translateX(0); }          /* pausa inicial (~3s) */
    60%     { transform: translateX(-105%); }      /* rola pra esquerda */
    78%     { transform: translateX(-105%); }      /* pausa no fim */
    100%    { transform: translateX(0); }          /* volta */
  }
  body.panel-compact .info-row {
    margin-top: 0;
    gap: 0.85vh;
    flex-shrink: 0;
    width: 100%;
  }
  /* Cards Local / Chamadas menores dentro do bloco principal */
  body.panel-compact #desk-card.pill {
    width: 64%;
    padding: 0.7vh 0.85vh;
    border-radius: 1.3vh;
  }
  body.panel-compact #desk-card .pill-label {
    font-size: 1.65vh;
    font-weight: 700;
    opacity: 0.9;
  }
  body.panel-compact #desk-card .pill-value {
    font-size: 3.2vh;
    font-weight: 900;
    line-height: 1.1;
    margin-top: 0.3vh;
  }
  body.panel-compact .kpi {
    width: 34%;
    padding: 0.6vh 0.65vh;
    border-radius: 1.3vh;
    gap: 0.4vh;
  }
  body.panel-compact .kpi-ticket {
    font-size: 6.2vh;
    font-weight: 900;
    line-height: 1;
  }
  body.panel-compact .kpi-calls-row {
    gap: 0.2vh;
  }
  body.panel-compact .kpi .kpi-value {
    font-size: 1.45vh;
  }
  body.panel-compact .kpi .kpi-label {
    font-size: 1.05vh;
  }

  /* Carrossel: próximas senhas e histórico — ALTURA MÁXIMA para não cortar */
  body.panel-compact .panel-columns {
    position: relative;
    flex-shrink: 0;
    max-height: 32vh;
    height: 32vh;
    width: 100%;
    justify-content: center;
    align-items: flex-start;
    margin-top: 0.4vh;
  }
  body.panel-compact .panel-columns > .card {
    position: absolute;
    left: 0;
    right: 0;
    width: 98% !important;
    max-width: 98vw;
    margin: 0 auto;
    height: 30vh;
    max-height: 30vh;
    padding: 0.8vh 0.95vh;
    border-radius: 1.4vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body.panel-compact .panel-columns > .card .card-title {
    font-size: 2.5vh;
    margin-bottom: 0.55vh;
    padding-bottom: 0.4vh;
    flex-shrink: 0;
  }
  body.panel-compact .panel-columns > .card .card-body {
    gap: 0.7vh;
    overflow-y: auto;
    flex: 1 1 0;
    min-height: 0;
  }
  body.panel-compact .panel-columns > .card .empty {
    margin-top: 1.5vh;
    font-size: 2.5vh;
    line-height: 1.25;
  }
  body.panel-compact .panel-columns > .card .empty .subtitle {
    font-size: 2.1vh;
    margin-top: 0.75vh;
  }
  body.panel-compact .next-grid {
    gap: 0.7vh;
    display: flex;
    flex-direction: column;
  }
  body.panel-compact #next-tickets .list-item {
    padding: 0.95vh 1vh;
    border-radius: 1.1vh;
    min-height: 7vh;
  }
  body.panel-compact #recent-tickets .list-item {
    padding: 0.95vh 1.05vh;
    border-radius: 1.1vh;
    min-height: 6.5vh;
  }
  body.panel-compact .panel-columns .badge-num {
    width: 3vh;
    height: 3vh;
    font-size: 1.65vh;
    margin-right: 0.75vh;
    flex-shrink: 0;
  }
  body.panel-compact .panel-columns .dot {
    width: 1.3vh;
    height: 1.3vh;
    margin-right: 0.85vh;
    flex-shrink: 0;
  }
  body.panel-compact .panel-columns > .card:first-child {
    animation: panelCompactCarA 18s infinite;
  }
  body.panel-compact .panel-columns > .card:last-child {
    animation: panelCompactCarB 18s infinite;
  }
  @keyframes panelCompactCarA {
    0%, 47% { opacity: 1; z-index: 2; }
    50%, 97% { opacity: 0; z-index: 1; pointer-events: none; }
    100% { opacity: 1; z-index: 2; }
  }
  @keyframes panelCompactCarB {
    0%, 47% { opacity: 0; z-index: 1; pointer-events: none; }
    50%, 97% { opacity: 1; z-index: 2; }
    100% { opacity: 0; z-index: 1; pointer-events: none; }
  }
  body.panel-compact .li-title {
    font-size: 2.9vh;
    font-weight: 800;
    line-height: 1.08;
  }
  body.panel-compact .li-sub {
    font-size: 2.65vh;
    height: auto;
    line-height: 1.1;
    opacity: 0.85;
    margin-top: 0.25vh;
  }
  body.panel-compact .li-right {
    font-size: 2.3vh;
    opacity: 0.78;
  }
  
  /* ===== Debug overlay sempre rolável ===== */
  #tv-debug-overlay{
    position:fixed; z-index:999999;
    top:8px !important; left:8px !important; right:8px !important; bottom:8px !important;
    max-height: calc(100vh - 16px) !important; overflow:auto !important;
  }
  