/* Mesmos tokens e regras do painel admin do AmplaTV (panel-admin/src). */
:root {
  color-scheme: dark;
  --tinta: #0b1220;
  --trilho: #0e1626;
  --painel: #142031;
  --elevado: #1e2c41;
  --regua: #2a3a52;
  --regua-forte: #3a4c68;
  --texto: #ecf2f8;
  --texto-claro: #c3d2e2;
  --texto-calmo: #92a6c0;
  --texto-apagado: #7f93ae;
  --amarelo: #f2cb1d;
  --amarelo-tinta: #14213a;
  --verde: #19b860;
  --verde-texto: #5ee39a;
  --vermelho: #ff4b4b;
  --vermelho-texto: #ffb3b3;
  --atencao: #ffa53c;
  --atencao-texto: #ffc27a;
  --fonte-titulo: "Familjen Grotesk", system-ui, sans-serif;
  --fonte-ui: "Instrument Sans", system-ui, sans-serif;
  --fonte-mono: "JetBrains Mono", ui-monospace, monospace;
  --raio-campo: 8px;
  --raio-cartao: 12px;
  --anel-foco: inset 0 0 0 3px var(--amarelo), 0 0 0 6px rgba(242, 203, 29, 0.2);
  --dur-padrao: 200ms;
  --curva: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: var(--fonte-ui);
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--tinta);
  color: var(--texto);
}
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--fonte-titulo);
}
p {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  min-height: 44px;
  color: var(--texto);
}
button {
  cursor: pointer;
  border: 0;
  font-weight: 600;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
input,
textarea,
select {
  width: 100%;
  border-radius: var(--raio-campo);
  background: var(--trilho);
  border: 1px solid var(--regua);
  padding: 10px 12px;
}
textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}
input:disabled {
  color: var(--texto-calmo);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--anel-foco) !important;
}
a {
  color: var(--texto-claro);
}
.mono {
  font-family: var(--fonte-mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.muted {
  color: var(--texto-calmo);
  line-height: 1.5;
}
.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--amarelo);
  font-size: 12px;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.campo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  min-width: 0;
}
.campo > span {
  color: var(--texto-claro);
}
.campo small {
  color: var(--texto-apagado);
  font-size: 12.5px;
}
.campos-linha {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 12px;
}

/* Trilho */
.trilho {
  position: fixed;
  inset: 0 auto 0 0;
  width: 88px;
  background: var(--trilho);
  border-right: 1px solid var(--regua);
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 16px;
  padding: 22px 10px;
  z-index: 20;
  overflow-y: auto;
}
.marca {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
}
.trilho nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.trilho button {
  width: 68px;
  min-height: 62px;
  flex-shrink: 0;
  padding: 8px 1px;
  border-radius: 10px;
  background: transparent;
  color: var(--texto-calmo);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
}
.trilho nav button > span {
  width: 84px;
  text-align: center;
  letter-spacing: -0.5px;
}
.trilho button.atual {
  background: var(--amarelo);
  color: var(--amarelo-tinta);
}
.trilho footer {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.trilho footer button {
  min-height: 44px;
}
.trilho .conta {
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: var(--elevado);
  color: var(--texto);
  font-size: 13px;
  font-weight: 600;
}

/* Conteúdo */
.dashboard-main {
  margin-left: 88px;
  padding: 30px 48px 40px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.cabecalho {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.cabecalho h1 {
  font-size: 40px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.cabecalho p {
  margin-top: 8px;
}
.cartao {
  background: var(--painel);
  border: 1px solid var(--regua);
  border-radius: var(--raio-cartao);
  min-width: 0;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cartao h2 {
  font-size: 20px;
}
.cartao h3 {
  font-size: 16px;
}
.split-view {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  min-width: 0;
}
.split-view > .cartao:first-child {
  flex: 1;
}

/* Botões */
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  transition: background var(--dur-padrao) var(--curva);
  text-decoration: none;
  white-space: nowrap;
}
.botao.principal {
  min-height: 48px;
  background: var(--amarelo);
  color: var(--amarelo-tinta);
}
.botao.suave {
  background: var(--elevado);
  color: var(--texto);
  border: 1px solid var(--regua);
}
.botao.fantasma {
  background: transparent;
  border: 1px solid var(--regua);
  color: var(--texto);
}
.botao.perigo {
  background: rgba(255, 75, 75, 0.1);
  color: var(--vermelho-texto);
  border: 1px solid rgba(255, 75, 75, 0.35);
}
.icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--texto-calmo);
  font-size: 24px;
}

/* Avisos e selos */
.aviso {
  min-height: 52px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  border: 1px solid;
  overflow-wrap: anywhere;
}
.aviso span {
  flex: 1;
}
.aviso.success {
  background: rgba(25, 184, 96, 0.1);
  border-color: rgba(25, 184, 96, 0.4);
  color: var(--verde-texto);
}
.aviso.error {
  background: rgba(255, 75, 75, 0.1);
  border-color: rgba(255, 75, 75, 0.4);
  color: var(--vermelho-texto);
}
.aviso.warning {
  background: rgba(255, 165, 60, 0.1);
  border-color: rgba(255, 165, 60, 0.4);
  color: var(--atencao-texto);
}
.aviso .icon-button {
  color: inherit;
}
.selo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--elevado);
  color: var(--texto-calmo);
}
.selo i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.selo.ok {
  color: var(--verde-texto);
  background: rgba(25, 184, 96, 0.13);
}
.selo.warning {
  color: var(--atencao-texto);
  background: rgba(255, 165, 60, 0.13);
}
.selo.failed {
  color: var(--vermelho-texto);
  background: rgba(255, 75, 75, 0.12);
}
.selo.running {
  color: var(--amarelo);
  background: rgba(242, 203, 29, 0.13);
}
.selo.running i {
  animation: pulso 1.2s ease-in-out infinite;
}
@keyframes pulso {
  50% {
    opacity: 0.35;
    transform: scale(0.7);
  }
}

/* Listas */
.ferramentas {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.ferramentas .campo {
  flex: 1;
  min-width: 180px;
}
.ferramentas .campo.compacto {
  flex: 0 0 230px;
}
.table-heading {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--regua);
  padding: 0 12px 8px;
  color: var(--texto-apagado);
  font-size: 12px;
}
.table-heading > :first-child {
  flex: 1;
  min-width: 0;
}
.lista {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.linha-tabela {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 8px 12px;
  background: transparent;
  color: var(--texto);
  text-align: left;
  border-radius: 8px;
  overflow: hidden;
  font-weight: 400;
}
.linha-tabela > :first-child {
  flex: 1;
  min-width: 0;
}
.linha-tabela > span {
  flex-shrink: 0;
}
.linha-tabela:hover {
  background: var(--elevado);
}
.linha-tabela.selecionada {
  background: var(--elevado);
  box-shadow: inset 3px 0 0 var(--amarelo);
}
.col-categoria {
  width: 170px;
  color: var(--texto-claro);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-selo {
  width: 150px;
}
.col-data {
  width: 120px;
  color: var(--texto-claro);
  white-space: nowrap;
}
.col-numero {
  width: 90px;
  color: var(--texto-claro);
  white-space: nowrap;
}
.item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.item > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.item strong,
.item small,
.ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.item strong {
  font-weight: 600;
}
.item small {
  color: var(--texto-calmo);
  font-size: 13px;
}
.miniatura {
  flex-shrink: 0;
  width: 36px;
  height: 52px;
  border-radius: 6px;
  background: var(--elevado) center / cover no-repeat;
  border: 1px solid var(--regua);
  display: grid;
  place-items: center;
  color: var(--texto-apagado);
  font: 600 13px var(--fonte-titulo);
}
.miniatura.canal {
  width: 52px;
  height: 40px;
  background-size: contain;
  background-color: var(--trilho);
}
.vazio {
  padding: 36px 12px;
  text-align: center;
  color: var(--texto-calmo);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.abas {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.abas button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--elevado);
  color: var(--texto-claro);
  border: 1px solid var(--regua);
  font-weight: 500;
}
.abas button.atual {
  background: var(--amarelo);
  color: var(--amarelo-tinta);
  border-color: var(--amarelo);
  font-weight: 600;
}

/* Gaveta e janela */
.gaveta {
  width: 440px;
  flex-shrink: 0;
  max-height: calc(100vh - 48px);
  overflow: auto;
  position: sticky;
  top: 24px;
}
.gaveta header h2,
.admin-modal header h2 {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 24px;
}
.gaveta section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--regua);
}
.voltar {
  align-self: flex-start;
  min-height: 36px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  background: transparent;
  color: var(--texto-claro);
  font-weight: 500;
}
.admin-modal {
  width: min(520px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  color: var(--texto);
  overflow: auto;
  padding: 22px 24px;
}
.admin-modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

/* Arquivos */
.imagem-campo {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.imagem-campo .campo {
  flex: 1;
}
.previa {
  flex-shrink: 0;
  width: 44px;
  height: 64px;
  border-radius: 6px;
  border: 1px solid var(--regua);
  background: var(--trilho) center / cover no-repeat;
}
.previa.larga {
  width: 88px;
  height: 50px;
}
.seletor-arquivos {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
  padding: 3px 14px 3px 3px;
  border-radius: var(--raio-campo);
  background: var(--trilho);
  box-shadow: inset 0 0 0 1px var(--regua);
  cursor: pointer;
}
.seletor-arquivos.arrastando,
.seletor-arquivos:focus-within {
  box-shadow: inset 0 0 0 2px var(--amarelo);
}
.seletor-arquivos .botao {
  min-height: 36px;
  flex-shrink: 0;
  pointer-events: none;
}
.seletor-arquivos input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.seletor-texto {
  flex: 1;
  min-width: 0;
  color: var(--texto-apagado);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.arquivo-atual {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--elevado);
}
.arquivo-atual > div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.arquivo-atual small {
  color: var(--texto-calmo);
}
.envio {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.envio small {
  color: var(--texto-calmo);
  font-variant-numeric: tabular-nums;
}
.progresso {
  height: 5px;
  border-radius: 999px;
  background: var(--elevado);
  overflow: hidden;
}
.progresso i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--amarelo);
  transition: width var(--dur-padrao) linear;
}
.acesso {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--elevado);
  align-items: center;
}
.acesso dt {
  color: var(--texto-calmo);
  font-size: 13px;
}
.acesso dd {
  margin: 0;
  min-width: 0;
}
.acesso + .botao {
  align-self: flex-start;
}

/* Entrada */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.auth-card {
  width: min(440px, 100%);
  background: var(--painel);
  border: 1px solid var(--regua);
  border-radius: var(--raio-cartao);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth-card h1 {
  font-size: 32px;
  letter-spacing: -0.02em;
}
.carregando {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--texto-calmo);
}

@media (max-width: 1279px) {
  .gaveta {
    position: fixed;
    right: 16px;
    top: 16px;
    bottom: 16px;
    z-index: 30;
    width: min(440px, calc(100vw - 112px));
    max-height: none;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55);
  }
  .dashboard-main {
    padding: 28px 24px;
  }
}
@media (max-width: 900px) {
  .col-categoria,
  .col-data {
    display: none;
  }
}
@media (max-width: 800px) {
  .cabecalho {
    align-items: flex-start;
    flex-direction: column;
  }
  .cabecalho h1 {
    font-size: 32px;
  }
  .dashboard-main {
    padding: 24px 16px;
  }
}
@media (max-width: 600px) {
  .trilho {
    inset: auto 0 0 0;
    width: auto;
    height: 72px;
    flex-direction: row;
    padding: 4px 8px;
    border-right: 0;
    border-top: 1px solid var(--regua);
    overflow-x: auto;
  }
  .trilho .marca,
  .trilho footer {
    display: none;
  }
  .trilho nav {
    flex-direction: row;
  }
  .trilho button {
    min-height: 62px;
  }
  .dashboard-main {
    margin-left: 0;
    padding-bottom: 96px;
  }
  .gaveta {
    left: 8px;
    right: 8px;
    top: 8px;
    bottom: 80px;
    width: auto;
  }
  .col-selo {
    width: auto;
  }
}
