﻿:root {
  --bg: #f3f7fc;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --line: rgba(37, 99, 235, 0.12);
  --text: #0f172a;
  --muted: #64748b;
  --blue: #2563eb;
  --blue-deep: #1d4ed8;
  --blue-soft: #60a5fa;
  --blue-mist: #dbeafe;
  --blue-sky: #eff6ff;
  --ok: #059669;
  --warn: #0284c7;
  --rose: #e11d48;
  --shadow: 0 18px 40px rgba(37, 99, 235, 0.08);
  --radius: 20px;
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(1000px 520px at 8% -8%, rgba(37, 99, 235, 0.14), transparent 55%),
    radial-gradient(900px 480px at 100% 0%, rgba(96, 165, 250, 0.16), transparent 50%),
    linear-gradient(180deg, #f8fbff 0%, #eef3fa 100%);
}

button,
input,
textarea {
  font: inherit;
}

.stage {
  height: 100vh;
  height: 100dvh;
  padding: 12px 18px 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stage.is-flash .hero-card {
  animation: callPulse 2.6s ease;
}

.bg-glow,
.bg-grid {
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.bg-grid {
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent 85%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  position: relative;
  z-index: 2;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand .brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand .brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--text);
}

.brand > div span {
  color: var(--muted);
  font-size: 0.9rem;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-meta time {
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--blue-deep);
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.chip:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--blue-sky);
}

.chip.on {
  background: var(--blue-mist);
  border-color: rgba(37, 99, 235, 0.45);
  color: var(--blue-deep);
}

.chip.primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  border: none;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.chip:disabled {
  opacity: 0.55;
  cursor: wait;
}

.banner-error {
  position: relative;
  z-index: 2;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
  flex-shrink: 0;
}

.layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
  background:
    linear-gradient(160deg, rgba(37, 99, 235, 0.12), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #f1f6ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.16);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2.2vh, 28px) clamp(16px, 3vw, 36px);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero-card.empty {
  border-color: var(--line);
  background: linear-gradient(180deg, #ffffff, #f5f8fc);
}

.hero-card.empty .hero-phrase {
  position: absolute;
  left: clamp(16px, 3vw, 36px);
  bottom: clamp(14px, 2.2vh, 28px);
  margin: 0;
  max-width: none;
  text-align: left;
}

.hero-pulse {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  right: -40px;
  top: -60px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.22), transparent 70%);
  animation: floatGlow 4s ease-in-out infinite;
}

.hero-sub {
  margin: 0;
  color: var(--blue);
  font-size: clamp(0.9rem, 1.6vw, 1.2rem);
  font-weight: 600;
  align-self: flex-start;
  text-align: left;
  width: 100%;
}

.hero-label {
  margin: 8px 0 0;
  font-size: calc(clamp(1.76rem, 3.85vh, 2.64rem) * var(--fonte-escala, 1));
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-deep);
}

.hero-title {
  margin: 2px 0 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: calc(clamp(4.18rem, 15.4vh, 9.9rem) * var(--fonte-escala, 1));
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: #0b1f44;
}

.hero-title.soft {
  color: #94a3b8;
  font-size: clamp(2.2rem, 6vh, 4rem);
}

.hero-title-pulse {
  animation: idPulse 1.4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes idPulse {
  0%,
  100% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(37, 99, 235, 0);
  }
  50% {
    transform: scale(1.06);
    text-shadow: 0 12px 36px rgba(37, 99, 235, 0.28);
    color: var(--blue-deep);
  }
}

.hero-phrase {
  margin: 0;
  max-width: 28ch;
  color: #334155;
  font-size: clamp(0.95rem, 1.8vh, 1.25rem);
  line-height: 1.4;
}

.hero-meta {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-wrap: wrap;
}

.pill {
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: var(--blue-mist);
  color: var(--blue-deep);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.last-called {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  flex-shrink: 0;
}

.last-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: center;
}

.last-card strong {
  font-size: 1.25rem;
  font-family: 'Syne', sans-serif;
  color: #0f172a;
}

.last-card span {
  grid-column: 1;
  color: var(--muted);
}

.last-card em {
  grid-row: 1 / span 2;
  font-style: normal;
  font-size: 1.25rem;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.last-card.muted strong,
.last-card.muted span {
  color: var(--muted);
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
}

.status-tile {
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.03);
}

.status-tile span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-tile strong {
  font-size: 1.55rem;
  font-family: 'Syne', sans-serif;
  line-height: 1;
}

.status-tile.ready strong {
  color: var(--ok);
}
.status-tile.prep strong {
  color: var(--warn);
}
.status-tile.call strong {
  color: var(--blue);
}
.status-tile.wait strong {
  color: var(--rose);
}
.status-tile.done strong {
  color: #0ea5e9;
}

.poll-hint {
  margin: 6px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.queue-list .delivered {
  border-color: rgba(14, 165, 233, 0.28);
  background: #f0f9ff;
}

.queue-block.entregues {
  flex: 0.9;
}

.hero-meta .chip.primary {
  margin-left: 0;
}

.queue-block {
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.queue-block.prep {
  flex: 0.7;
}

.block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.block-head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.block-head span {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  color: var(--blue);
}

.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-list button,
.queue-list .static {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--blue-sky);
  color: inherit;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}

.queue-list .static {
  grid-template-columns: 1fr auto;
  cursor: default;
  background: #f8fafc;
}

.queue-list button:hover {
  border-color: rgba(37, 99, 235, 0.4);
  background: var(--blue-mist);
}

.q-pos {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-mist);
  color: var(--blue-deep);
  font-weight: 700;
  font-size: 0.85rem;
}

.q-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.q-main strong {
  font-size: 1.05rem;
  color: #0f172a;
}

.q-main small {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.queue-empty {
  color: var(--muted);
  padding: 18px 8px;
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
}

/* hidden precisa vencer o display:grid acima */
.modal-backdrop[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.modal {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.modal h2 {
  margin: 0 0 8px;
  font-family: 'Syne', sans-serif;
  color: #0f172a;
}

.modal p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

.modal code {
  color: var(--blue-deep);
  background: var(--blue-mist);
  padding: 1px 6px;
  border-radius: 6px;
}

.modal label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal input,
.modal textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
  padding: 12px 14px;
  resize: vertical;
}

.modal input:focus,
.modal textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

@keyframes floatGlow {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translateY(18px) scale(1.08);
    opacity: 1;
  }
}

@keyframes callPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    transform: scale(1);
  }
  35% {
    box-shadow: 0 0 0 18px rgba(37, 99, 235, 0);
    transform: scale(1.012);
  }
  100% {
    box-shadow: var(--shadow);
    transform: scale(1);
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .hero-card {
    min-height: 240px;
    flex: none;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  html,
  body,
  #app {
    overflow: auto;
  }

  .stage {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
}

.layout-tv {
  grid-template-columns: 1fr;
}

.stage.mode-tv .hero-card {
  min-height: 0;
  flex: 1;
}

.stage.mode-tv .hero-label {
  font-size: calc(clamp(2.42rem, 6.05vh, 3.96rem) * var(--fonte-escala, 1));
  margin-bottom: 4px;
}

.stage.mode-tv .hero-title {
  font-size: calc(clamp(4.95rem, 17.6vh, 12.1rem) * var(--fonte-escala, 1));
}

.tv-ultimas {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  flex-shrink: 0;
  overflow: hidden;
}

.tv-ultimas-empty {
  color: var(--muted);
  padding: 12px 4px;
}

.tv-ultimas-grid {
  list-style: none;
  margin: 0;
  padding: 0 0 6px;
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.tv-ultimas-grid::-webkit-scrollbar {
  height: 8px;
}

.tv-ultimas-grid::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.35);
  border-radius: 999px;
}

.tv-ultimas-grid::-webkit-scrollbar-track {
  background: var(--blue-sky);
  border-radius: 999px;
}

.tv-ultima-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--blue-sky);
  border: 1px solid var(--line);
  flex: 0 0 calc((100% - 72px) / 7);
  min-width: 140px;
  max-width: 220px;
}

.tv-ultima-card strong {
  font-family: 'Syne', sans-serif;
  font-size: 1.55rem;
  color: #0b1f44;
  line-height: 1.1;
}

.tv-ultima-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.tv-ultima-card em {
  font-style: normal;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  margin-top: 4px;
}

.toggles span.chip {
  cursor: default;
}

.toggles button.chip {
  cursor: pointer;
}

.cfg-hint { margin-top: -6px; font-size: 0.85rem; color: #64748b; }
.cfg-hint code { color: var(--blue-deep); background: var(--blue-mist); padding: 1px 6px; border-radius: 6px; }
.cfg-erro {
  display: none;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff1f2 !important;
  border: 1px solid #fecdd3 !important;
  color: #9f1239 !important;
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 600;
}
.cfg-erro.is-visible,
.cfg-erro:not([hidden]) {
  display: block !important;
}
.modal-backdrop[data-has-error="1"] .cfg-erro {
  display: block !important;
}
.stage.modal-open #banner {
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

