:root {
  --navy: #1f3864;
  --navy-escuro: #16294a;
  --navy-suave: #eef1f7;
  --azul-claro: #8eaadb;
  --verde: #1e7d43;
  --verde-fundo: #e5f4ea;
  --amarelo: #a3690a;
  --amarelo-fundo: #fdf1de;
  --vermelho: #b3261e;
  --vermelho-fundo: #fbe9e7;
  --texto: #1c2430;
  --texto-suave: #5c6774;
  --borda: #e1e5eb;
  --fundo: #eef1f6;
  --superficie: #ffffff;
  --sombra: 0 1px 2px rgba(23, 43, 77, 0.06), 0 8px 24px rgba(23, 43, 77, 0.06);
  --sombra-hover: 0 2px 4px rgba(23, 43, 77, 0.08), 0 12px 28px rgba(23, 43, 77, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1100px 480px at 50% -10%, #dce4f2 0%, transparent 60%),
    var(--fundo);
  color: var(--texto);
  display: flex;
  justify-content: center;
  padding: 56px 16px;
  -webkit-font-smoothing: antialiased;
}

.pagina {
  width: 100%;
  max-width: 560px;
}

.topo {
  text-align: center;
  margin-bottom: 32px;
}

.topo h1 {
  color: var(--navy);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.subtitulo {
  margin: 0;
  color: var(--texto-suave);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cartao {
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--sombra);
}

.cartao label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--texto-suave);
  margin-bottom: 8px;
}

.cartao input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--texto);
  background: #fbfcfd;
  border: 1.5px solid var(--borda);
  border-radius: 9px;
  margin-bottom: 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cartao input::placeholder {
  color: #9aa4b2;
}

.cartao input:hover {
  border-color: #c3cbd6;
}

.cartao input:focus {
  outline: none;
  background: #fff;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px rgba(31, 56, 100, 0.12);
}

.botao-principal {
  width: 100%;
  padding: 15px;
  font-size: 15.5px;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(180deg, #24406f, var(--navy));
  border: none;
  border-radius: 9px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 6px 16px rgba(31, 56, 100, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.botao-principal:hover:not(:disabled) {
  background: linear-gradient(180deg, #2a4a80, var(--navy-escuro));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 10px 22px rgba(31, 56, 100, 0.32);
  transform: translateY(-1px);
}

.botao-principal:active:not(:disabled) {
  transform: translateY(0);
}

.botao-principal:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.mensagem-erro {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: var(--vermelho-fundo);
  color: var(--vermelho);
  border: 1px solid rgba(179, 38, 30, 0.18);
  border-radius: 9px;
  font-size: 13.5px;
  line-height: 1.5;
}

.area-status {
  margin-top: 22px;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: 14px;
  padding: 22px 26px 24px;
  box-shadow: var(--sombra);
}

.status-cabecalho {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--borda);
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2.5px solid var(--navy-suave);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: girar 0.7s linear infinite;
}

.spinner.parado {
  animation: none;
  border: none;
  width: auto;
  height: auto;
  color: var(--verde);
  font-weight: 800;
}

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

.lista-itens {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fafbfc;
  border: 1px solid var(--borda);
  border-radius: 10px;
  font-size: 14px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.item:hover {
  background: #f5f7fa;
  border-color: #d3d9e1;
}

.item-info {
  min-width: 0;
}

.item-cliente {
  font-weight: 700;
  color: var(--texto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-motivo {
  font-size: 12.5px;
  color: var(--texto-suave);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.selo::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.selo-concluido {
  background: var(--verde-fundo);
  color: var(--verde);
}

.selo-pendencia {
  background: var(--amarelo-fundo);
  color: var(--amarelo);
}

.item-acoes {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.link-baixar {
  color: var(--navy);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 7px;
  transition: background 0.15s ease;
}

.link-baixar:hover {
  background: var(--navy-suave);
  text-decoration: none;
}

.botao-lapis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 14px;
  color: var(--texto-suave);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.botao-lapis:hover {
  color: var(--navy);
  background: var(--navy-suave);
  border-color: var(--borda);
}

.modal-editor {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--fundo);
}

.modal-editor[hidden] {
  display: none;
}

.editor-cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: var(--superficie);
  border-bottom: 1px solid var(--borda);
  box-shadow: var(--sombra);
}

#editorTitulo {
  font-weight: 700;
  color: var(--navy);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-acoes {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.editor-separador {
  width: 1px;
  height: 22px;
  background: var(--borda);
  margin: 0 6px;
}

.botao-formato {
  width: 32px;
  height: 32px;
  font-size: 13px;
  color: var(--texto);
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.botao-formato:hover {
  background: var(--navy-suave);
  border-color: var(--navy);
}

.botao-secundario {
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  color: var(--texto-suave);
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.botao-secundario:hover {
  background: var(--navy-suave);
}

.botao-salvar {
  width: auto;
  padding: 9px 20px;
  font-size: 13.5px;
}

.editor-conteudo {
  flex: 1;
  overflow-y: auto;
  max-width: 820px;
  width: 100%;
  margin: 24px auto 0;
  padding: 56px 64px;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: 10px 10px 0 0;
  box-shadow: var(--sombra);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--texto);
}

.editor-conteudo:focus {
  outline: none;
}

.editor-conteudo img {
  max-width: 100%;
}

.editor-mensagem {
  max-width: 820px;
  width: calc(100% - 32px);
  margin: 12px auto;
}

.vazio {
  color: var(--texto-suave);
  font-size: 13.5px;
  text-align: center;
  padding: 14px 0 4px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy: #6f93cd;
    --navy-escuro: #7fa2db;
    --navy-suave: #1c2636;
    --azul-claro: #4a6690;
    --verde: #6fcf97;
    --verde-fundo: #163524;
    --amarelo: #e0ac4f;
    --amarelo-fundo: #3a2e14;
    --vermelho: #f28b82;
    --vermelho-fundo: #3a1e1c;
    --texto: #e8ecf2;
    --texto-suave: #9aa7b8;
    --borda: #2a3341;
    --fundo: #10151f;
    --superficie: #171e2b;
    --sombra: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --sombra-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 12px 28px rgba(0, 0, 0, 0.4);
  }

  body {
    background:
      radial-gradient(1100px 480px at 50% -10%, #1c2740 0%, transparent 60%),
      var(--fundo);
  }

  .cartao input {
    background: #12182384;
  }

  .cartao input:focus {
    background: var(--superficie);
    box-shadow: 0 0 0 4px rgba(111, 147, 205, 0.18);
  }

  .item {
    background: #141b28;
  }

  .item:hover {
    background: #182030;
  }

  .botao-principal {
    color: #0d1420;
    background: linear-gradient(180deg, #7fa2db, var(--navy));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 6px 16px rgba(0, 0, 0, 0.4);
  }

  .botao-principal:hover:not(:disabled) {
    background: linear-gradient(180deg, #8fb0e2, #6f93cd);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 10px 22px rgba(0, 0, 0, 0.45);
  }
}
