@font-face {
  font-family: "Globotipo Corporativa";
  src: url("./assets/fonts/GlobotipoCorporativa-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Globotipo Corporativa";
  src: url("./assets/fonts/GlobotipoCorporativa-Bold.ttf") format("truetype");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #111111;
  --muted: #666666;
  --line: #dedede;
  --soft: #f6f6f6;
  --panel: #ffffff;
  --accent: #006b5f;
  --accent-dark: #004a42;
  --warning: #c27803;
  --danger: #b42318;
  --done: #12733d;
  font-family: "Globotipo Corporativa", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #ffffff;
  color: var(--ink);
}

body:has(.display-shell) {
  height: 100vh;
  overflow: hidden;
  background-color: #06131f;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

body:has(.display-shell)[data-background="manha"] {
  background-image: url("./assets/MANHA.png");
}

body:has(.display-shell)[data-background="noite"] {
  background-image: url("./assets/NOITE.png");
}

body:has(.display-shell)[data-background="globo-esporte"] {
  background-image: url("./assets/GLOBOESPORTE.png");
}

body:has(.display-shell) {
  color: #ffffff;
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --line: rgba(255, 255, 255, 0.28);
}

button,
input,
select,
textarea {
  font: inherit;
}

.coordination-shell,
.display-shell {
  width: min(1500px, calc(100% - clamp(24px, 4vw, 72px)));
  margin: 0 auto;
}

.coordination-shell {
  padding: 34px 0 42px;
}

.coordination-header,
.display-header,
.status-row,
.ticker,
.program-card,
.display-card {
  background: transparent;
}

.coordination-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.eyebrow,
.status-label,
.ticker span,
.card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 3px 0 0;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  letter-spacing: 0;
  line-height: 1;
}

.ghost-link {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  font-weight: 700;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 16px 18px;
}

.single-status {
  grid-template-columns: 1fr;
}

.status-row strong {
  display: block;
  margin-top: 5px;
  font-size: 1.1rem;
}

.input-panel {
  display: grid;
  gap: 16px;
}

.wide-field {
  grid-column: 1 / -1;
}

.input-panel > .wide-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--soft);
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  padding: 11px 12px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 107, 95, 0.14);
}

.program-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 16px;
}

.program-card legend {
  padding: 0 6px;
  font-weight: 800;
}

.calls-section,
.bulletin-section {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.compact-button {
  min-height: 38px;
  padding: 0 12px;
}

.add-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
}

.calls-list {
  display: grid;
  gap: 10px;
}

.call-row,
.bulletin-row {
  display: grid;
  grid-template-columns: minmax(80px, 0.6fr) minmax(180px, 1.6fr) minmax(120px, 1fr) minmax(120px, 1fr) 46px;
  align-items: end;
  gap: 10px;
}

.bulletin-row {
  grid-template-columns: minmax(80px, 0.6fr) minmax(180px, 1.6fr) minmax(120px, 1fr) minmax(120px, 1fr);
}

.icon-button {
  min-width: 46px;
  padding: 0;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  background: #eeeeee;
  color: var(--ink);
}

.display-shell {
  display: grid;
  height: 100vh;
  aspect-ratio: 16 / 9;
  max-width: min(100vw, calc(100vh * 16 / 9));
  width: min(100vw, calc(100vh * 16 / 9));
  align-content: stretch;
  grid-template-rows: auto 1fr;
  gap: clamp(6px, 1vh, 12px);
  padding: clamp(8px, 1.2vh, 14px) clamp(18px, 2.4vw, 34px) clamp(12px, 1.8vh, 22px);
}

.display-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  align-self: start;
  min-height: 34px;
  color: var(--ink);
}

.display-topbar span,
.display-topbar strong {
  font-size: clamp(0.95rem, 1.45vw, 1.55rem);
  line-height: 1;
}

.display-topbar span {
  font-weight: 700;
  text-transform: capitalize;
}

.display-topbar strong {
  font-size: clamp(1.05rem, 2vw, 2.1rem);
}

.display-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 14px;
  min-height: 0;
}

.single-display {
  grid-template-columns: minmax(0, 1fr);
}

.display-card {
  display: grid;
  min-height: 0;
  gap: clamp(4px, 0.8vh, 10px);
  padding: clamp(6px, 1vw, 14px) 0 0;
}

.program-display-card {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto 1fr auto;
}

.program-hero {
  display: grid;
  justify-items: center;
  gap: clamp(24px, 4vh, 46px);
  padding: 0;
  text-align: center;
}

.program-hero h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(3.4rem, 10vw, 8.4rem);
  line-height: 0.92;
}

.program-logo {
  display: block;
  width: auto;
  height: clamp(82px, 14vh, 170px);
  max-width: min(88vw, 980px);
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.38));
}

.program-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: clamp(1.2rem, 2vw, 2.05rem);
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  padding: 0.12em 0.75em;
  background: rgba(0, 0, 0, 0.12);
}

.countdown-panel {
  display: grid;
  align-self: center;
  justify-items: center;
  gap: 8px;
  margin: 0;
  padding: clamp(8px, 2vh, 18px) 0;
  text-align: center;
  transform: translateY(-4vh);
}

.countdown-panel strong {
  font-size: clamp(4.2rem, 18vh, 11rem);
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.countdown-panel strong[data-state="warning"] {
  color: #ffd23f;
}

.countdown-panel strong[data-state="danger"],
.countdown-panel strong[data-state="on-air"] {
  color: #ff3b30;
}

.countdown-panel .card-meta {
  color: var(--ink);
  font-size: clamp(1.6rem, 4vh, 3.2rem);
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  padding: 0.12em 0.65em;
  background: rgba(0, 0, 0, 0.12);
}

.display-section {
  display: grid;
  gap: 12px;
}

.display-bottom {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(220px, 1fr);
  align-items: end;
  align-self: end;
  gap: clamp(18px, 4vw, 64px);
  min-height: 0;
}

.calls-display-section {
  justify-items: stretch;
  text-align: left;
  align-self: stretch;
  max-height: clamp(210px, 34vh, 340px);
  overflow: hidden;
}

.calls-stack {
  display: grid;
  align-self: end;
  gap: clamp(8px, 1.4vh, 14px);
}

.bulletin-display-section {
  justify-items: stretch;
}

.display-section h2 {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.72rem, 1vw, 1rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.display-topbar span,
.display-topbar strong,
.display-call-row,
.observations-section strong {
  font-size: clamp(1.45rem, 2.25vw, 2.25rem);
}

.display-calls {
  display: grid;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  max-height: calc((clamp(1.45rem, 2.25vw, 2.25rem) * 1.25 + 16px) * 6 + 24px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.62) rgba(255, 255, 255, 0.16);
}

.display-calls::-webkit-scrollbar {
  width: 6px;
}

.display-calls::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.display-calls::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.62);
  border-radius: 999px;
}

.display-call-head,
.display-call-row {
  display: grid;
  grid-template-columns: minmax(70px, max-content) minmax(210px, max-content) minmax(110px, max-content) minmax(100px, max-content);
  align-items: center;
  column-gap: clamp(16px, 2vw, 28px);
}

.display-call-head {
  padding: 0 10px 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(0.8rem, 1.15vw, 1.05rem);
  font-weight: 800;
  text-align: center;
}

.display-call-head span,
.display-call-row span,
.display-call-row strong {
  justify-self: center;
  text-align: center;
}

.display-call-row {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 6px;
}

.display-call-row.bulletin-display-row {
  background: rgba(0, 112, 210, 0.34);
}

.display-call-row span,
.display-call-row strong {
  overflow-wrap: normal;
  white-space: nowrap;
}

.display-call-row span {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 800;
}

.display-call-row strong {
  color: #ffffff;
  font-weight: 900;
}

.observations-section {
  justify-items: end;
  align-self: end;
  padding-top: 0;
  text-align: right;
}

.observations-section strong {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.status-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  background: #efefef;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.status-pill[data-status="Em produção"] {
  background: #fff3d7;
  color: var(--warning);
}

.status-pill[data-status="Em revisão"] {
  background: #eaf2ff;
  color: #1849a9;
}

.status-pill[data-status="Fechado"] {
  background: #e9f7ef;
  color: var(--done);
}

.highlight {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  font-weight: 750;
  line-height: 1.22;
}

.forecast {
  align-self: end;
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.forecast strong {
  font-size: clamp(1.05rem, 1.4vw, 1.45rem);
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  min-height: 52vh;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.cleared-panel-image {
  display: grid;
  grid-column: 1 / -1;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 1;
}

.cleared-panel-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loader {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border: 4px solid #dedede;
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .program-card,
  .display-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .single-display {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .coordination-shell,
  .display-shell {
    width: min(100% - 20px, 1180px);
  }

  .coordination-header,
  .display-header,
  .status-row,
  .ticker {
    grid-template-columns: 1fr;
  }

  .coordination-header,
  .display-header {
    align-items: start;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .ghost-link,
  .actions,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .actions {
    flex-direction: column-reverse;
  }

  .program-card,
  .display-grid {
    grid-template-columns: 1fr;
  }

  .program-summary {
    grid-template-columns: 1fr;
  }

  .section-title,
  .call-row,
  .bulletin-row,
  .display-call-head,
  .display-call-row {
    grid-template-columns: 1fr;
  }

  .display-bottom {
    grid-template-columns: 1fr;
  }

  .display-card {
    min-height: 260px;
  }

  .display-topbar {
    align-items: flex-start;
  }
}
