:root {
  --bg: #0e1015;
  --surface: #171a22;
  --surface-2: #1e222c;
  --border: #2a2f3c;
  --text: #e8eaf0;
  --muted: #98a0b3;
  --accent: #ff6b35;
  --accent-soft: rgba(255, 107, 53, 0.14);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --roxo: #a78bfa;
  --radius: 12px;
}

* { box-sizing: border-box; }

/* Sem isto o display das classes ganha do hidden do navegador e o elemento continua na tela. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px 64px; }

/* ---------- topo ---------- */
.topo {
  border-bottom: 1px solid var(--border);
  background: rgba(14, 16, 21, 0.92);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.topo-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.marca { font-weight: 800; font-size: 17px; letter-spacing: -0.3px; white-space: nowrap; }
.marca span { color: var(--accent); }
.topo .marca { display: inline-flex; align-items: center; gap: 9px; }
/* em, e nao px: o brasao acompanha o tamanho da letra da marca em vez de ter altura propria. */
.brasao-topo { height: 1.6em; width: auto; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.ativo { background: var(--accent-soft); color: var(--accent); }
.topo-dir { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.quem { color: var(--muted); font-size: 13px; }

/* ---------- blocos ---------- */
.titulo-pagina { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin: 28px 0 4px; }
.subtitulo { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
h2.secao { font-size: 15px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin: 32px 0 14px; font-weight: 700; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.grade { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }

.kpi .valor { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.kpi .rotulo { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.7px; margin-top: 2px; }
.kpi .nota { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ---------- botoes ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: #3a4152; }
.btn-primario { background: var(--accent); border-color: var(--accent); color: #17100c; }
.btn-primario:hover { filter: brightness(1.08); }
.btn-perigo { color: var(--danger); }
.btn-mini { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-bloco { width: 100%; justify-content: center; }

/* ---------- formularios ---------- */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; min-height: 84px; }
.campo { margin-bottom: 14px; }
.linha-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.escolha {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.escolha input { width: auto; margin: 0; cursor: pointer; }
.dica { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.entrega-texto { display: block; margin-top: 4px; white-space: pre-wrap; color: var(--muted); }

.alerta {
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid;
}
.alerta-erro { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.35); color: #fca5a5; }

/* ---------- tabela / ranking ---------- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  padding: 0 10px 10px;
  font-weight: 700;
}
td { padding: 11px 10px; border-top: 1px solid var(--border); font-size: 14px; }
tr.eu td { background: var(--accent-soft); }
.pos { font-weight: 800; color: var(--muted); width: 42px; }
.pos.p1 { color: #fbbf24; }
.pos.p2 { color: #cbd5e1; }
.pos.p3 { color: #d09a6a; }
.pontos-cel { font-weight: 800; text-align: right; }
.sumido { color: var(--warn); font-size: 12px; }

/* ---------- selos ---------- */
.selo {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}
.selo-ok { background: var(--ok-soft); color: var(--ok); }
.selo-fazendo { background: var(--warn-soft); color: var(--warn); }
.selo-afazer { background: var(--surface-2); color: var(--muted); }
.selo-pontos { background: var(--accent-soft); color: var(--accent); }
.selo-atrasado { background: rgba(248, 113, 113, 0.14); color: var(--danger); }

/* ---------- missoes ---------- */
.missao-card { display: flex; flex-direction: column; gap: 10px; }
.missao-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.missao-titulo { font-weight: 700; font-size: 16px; letter-spacing: -0.2px; }
.missao-meta { color: var(--muted); font-size: 13px; }
.barra { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.barra > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.barra.cheia > span { background: var(--ok); }

/* ---------- barra de acoes do quadro ---------- */
.acoes-quadro { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.dobra > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  justify-content: center;
}
.dobra > summary::-webkit-details-marker { display: none; }
.acoes-quadro .dobra[open] { flex: 1 1 100%; }
.acoes-quadro .dobra-corpo { margin-top: 10px; }
.acoes-quadro .dobra-corpo .campo:last-of-type { margin-bottom: 14px; }

/* ---------- kanban ---------- */
.kanban {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 14px;
  user-select: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.kanban input, .kanban textarea, .kanban select { user-select: auto; }
.kanban::-webkit-scrollbar { height: 12px; }
.kanban::-webkit-scrollbar-track { background: transparent; }
.kanban::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  background-clip: content-box;
  border: 3px solid transparent;
  border-radius: 999px;
}
.kanban::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.32); background-clip: content-box; }

.coluna {
  flex: 1 1 0;
  min-width: 236px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.coluna.arrastando { opacity: 0.45; transform: scale(0.98); }
.coluna-padrao { border-top: 3px solid var(--accent); }
.coluna-padrao .coluna-tag { color: var(--accent); }
.coluna-minha { border-top: 3px solid var(--roxo); }
.coluna-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 8px;
  cursor: grab;
}
.coluna-topo:active { cursor: grabbing; }
.coluna-topo strong { font-size: 13px; text-transform: uppercase; letter-spacing: 0.7px; }
.coluna-topo-dir { display: flex; align-items: center; gap: 2px; }
.coluna-topo-dir form { display: inline; }
.coluna-topo-dir .conta { margin-right: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
/* min-height segura a altura quando a etiqueta esta vazia, senao as colunas desalinham. */
.coluna-tag { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; line-height: 15px; min-height: 15px; }
.coluna-corpo { min-height: 70px; }
.coluna-corpo.alvo { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 10px; }
.coluna-vazia { color: var(--muted); font-size: 12px; padding: 18px 8px; text-align: center; border: 1px dashed var(--border); border-radius: 10px; }
.btn-x { background: none; border: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.btn-x:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.coluna-topo-dir form .btn-x:hover { color: var(--danger); }

.dobra-coluna { margin-top: 10px; }
.dobra-coluna > summary { opacity: 0.75; }
.dobra-coluna > summary:hover { opacity: 1; }
.dobra-coluna[open] > summary { opacity: 1; margin-bottom: 8px; }
.dobra-coluna input { margin-bottom: 8px; font-size: 13px; padding: 8px 10px; }

.cartao { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; cursor: grab; }
.cartao:active { cursor: grabbing; }
.cartao.arrastando { opacity: 0.4; }
.cartao-missao { border-left-color: var(--accent); }
.cartao-pessoal { border-left-color: var(--roxo); }
.cartao-titulo { font-weight: 600; font-size: 14px; margin-bottom: 6px; display: block; }
.cartao-meta { color: var(--muted); display: block; }
.cartao-pessoal .cartao-meta { color: var(--roxo); }
.cartao-acoes { position: relative; z-index: 1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.cartao-acoes form { display: inline; }

/* O titulo da missao estica por cima do cartao inteiro: clicar em qualquer canto abre a missao. */
a.cartao-titulo, .corpo-link { color: inherit; text-decoration: none; }
a.cartao-titulo:hover, .corpo-link:hover strong { color: var(--accent); }
.cartao-inteiro::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cartao-abre > summary { list-style: none; cursor: pointer; }
.cartao-abre > summary::-webkit-details-marker { display: none; }
.cartao-abre[open] > summary .cartao-titulo { color: var(--roxo); }
.editor { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 10px; }
.editor form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.editor-campo { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.editor-campo input { font-size: 13px; padding: 7px 9px; border-radius: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.mover { display: inline-flex; gap: 6px; align-items: center; }
.mover select { font-size: 12px; padding: 4px 6px; border-radius: 7px; background: var(--surface); color: var(--text); border: 1px solid var(--border); max-width: 150px; }

/* ---------- calendario ---------- */
.cal-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-mes { font-weight: 700; font-size: 15px; }
/* minmax(0,...) e obrigatorio: com 1fr puro o nome longo da missao alarga so a coluna daquele dia. */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; padding-bottom: 4px; text-transform: uppercase; }
.cal-dia {
  min-height: 74px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 6px;
  background: var(--surface);
  font-size: 12px;
}
.cal-dia.fora { opacity: 0.32; }
.cal-dia.hoje { border-color: var(--accent); }
.cal-num { color: var(--muted); font-weight: 700; font-size: 11px; }
.cal-dia.hoje .cal-num { color: var(--accent); }
.cal-ev {
  display: block;
  margin-top: 4px;
  padding: 3px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-ev.pessoal { background: var(--surface-2); color: var(--muted); }
.cal-agenda { display: none; margin-top: 14px; flex-direction: column; gap: 8px; }
.agenda-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.agenda-dia { flex: none; font-weight: 700; font-size: 12px; color: var(--accent); }
.agenda-item.pessoal .agenda-dia { color: var(--muted); }
.agenda-titulo { min-width: 0; }

/* ---------- entrar ---------- */
.tela-entrar { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.caixa-entrar { width: 100%; max-width: 400px; }
/* 3.4em do tamanho da marca (30px): o brasao cresce junto se a fonte mudar. */
.brasao-entrar { display: block; width: 3.4em; height: auto; margin: 0 auto 16px; font-size: 30px; }
.caixa-entrar .marca { font-size: 30px; text-align: center; margin-bottom: 6px; }
.caixa-entrar .sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.divisor { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divisor::before, .divisor::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- diversos ---------- */
.vazio { color: var(--muted); font-size: 14px; padding: 22px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius); }
.abas { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.abas a { padding: 7px 14px; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--muted); }
.abas a.ativo { background: var(--accent); color: #17100c; }
.lista-item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--border); }
.lista-item:first-child { border-top: none; }
.lista-item .corpo { flex: 1; min-width: 0; }
.lista-item .corpo small { color: var(--muted); }
.acoes-inline { display: flex; gap: 6px; }
.acoes-inline form { display: inline; }
.log-linha { font-size: 13px; color: var(--muted); padding: 8px 0; border-top: 1px solid var(--border); }
.log-linha b { color: var(--text); font-weight: 600; }

@media (max-width: 900px) {
  .split, .g4, .g3, .g2, .linha-campos { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-dia { min-height: 58px; }
}

@media (max-width: 760px) {
  .container { padding: 0 16px 56px; }
  .topo-inner { padding: 10px 16px; gap: 10px 14px; }
  .nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 7px 10px; }
  .quem { display: none; }
  .titulo-pagina { font-size: 22px; margin-top: 20px; }
  /* iOS da zoom no campo quando a fonte e menor que 16px */
  input, textarea, select, .mover select, .dobra-coluna input { font-size: 16px; }
  .abas { display: flex; width: 100%; }
  .abas a { flex: 1; text-align: center; padding: 8px 6px; }
  .acoes-quadro .dobra { flex: 1 1 100%; }
  .kanban { gap: 12px; margin: 0 -16px; padding: 0 16px 14px; scroll-snap-type: x mandatory; }
  .coluna { flex: 0 0 86%; min-width: 0; scroll-snap-align: center; }
  /* Alvo de toque: no dedo, botao de 18px nao acerta. */
  .btn-mini { padding: 8px 12px; font-size: 13px; }
  .coluna-topo-dir .btn-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    font-size: 20px;
  }
  .cartao-acoes { gap: 8px; }
  .mover { flex: 1 1 100%; }
  .mover select { max-width: none; flex: 1; padding: 8px 10px; }
  .lista-item { flex-wrap: wrap; gap: 10px; }
  td, th { padding-left: 6px; padding-right: 6px; }
  .cal { gap: 3px; }
  .cal-dia { min-height: 48px; padding: 4px; }
  /* Numa celula de 45px o titulo vira "Re...". Aqui o evento e so a marca; quem le e a agenda abaixo. */
  .cal-ev { height: 6px; margin-top: 3px; padding: 0; border-radius: 3px; font-size: 0; background: var(--accent); }
  .cal-ev.pessoal { background: var(--muted); }
  .cal-agenda { display: flex; }
}
