:root {
  --marinho: #0a1220;
  --marinho-2: #121d31;
  --marinho-3: #1c2a44;
  --azul: #2563eb;
  --ciano: #06b6d4;
  --gradiente: linear-gradient(135deg, #2563eb, #06b6d4);
  --fundo: #f3f5f9;
  --cartao: #ffffff;
  --borda: #e3e7ef;
  --texto: #0f172a;
  --suave: #5b6578;
  --vermelho: #dc2626;
  --vermelho-claro: #fdecec;
  --verde: #15803d;
  --verde-claro: #e7f6ec;
  --azul-claro: #e8f0fe;
  --cinza-claro: #eef1f5;
  --raio: 12px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .04);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--texto);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.6rem; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 1rem; font-weight: 700; }
small { color: var(--suave); }
:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 40px; padding: .5rem 1rem; border-radius: 10px;
  border: 1px solid var(--borda); background: #fff; color: var(--texto);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--cinza-claro); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--pri { background: var(--gradiente); border-color: transparent; color: #fff; }
.btn--pri:hover { background: var(--gradiente); filter: brightness(1.06); }
.btn--perigo { background: var(--vermelho); border-color: transparent; color: #fff; }
.btn--perigo:hover { background: #b91c1c; }
.btn--perigo-texto { color: var(--vermelho); }
.btn--fantasma { background: transparent; border-color: transparent; }
.btn--peq { min-height: 32px; padding: .3rem .7rem; font-size: .85rem; }
.btn--bloco { width: 100%; }

.input {
  width: 100%; min-height: 42px; padding: .55rem .75rem;
  border: 1px solid var(--borda); border-radius: 10px; background: #fff;
  font: inherit; color: var(--texto);
}
.input:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
textarea.input { resize: vertical; }
.campo { display: flex; flex-direction: column; gap: .3rem; min-width: 0; flex: 1; }
.campo label { font-size: .85rem; font-weight: 600; }
.form-pilha { display: flex; flex-direction: column; gap: 1rem; }
.form-linha { display: flex; gap: .8rem; }
.check { display: flex; gap: .5rem; align-items: center; font-size: .92rem; }
.escolha { border: 1px solid var(--borda); border-radius: 10px; padding: .6rem .9rem .8rem; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.escolha legend { font-size: .85rem; font-weight: 600; padding: 0 .3rem; }
.escolha label { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; }
.escolha small { width: 100%; padding-left: 1.4rem; margin-top: -.2rem; }
.aviso { margin: 0; padding: .7rem .9rem; border-radius: 10px; background: var(--azul-claro); color: #1e3a8a; font-size: .9rem; }
.aviso--suave { background: var(--cinza-claro); color: var(--suave); }

/* ---------- Selos ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem;
  border-radius: 999px; font-size: .75rem; font-weight: 650; white-space: nowrap;
  background: var(--cinza-claro); color: var(--suave); vertical-align: middle;
}
.badge--vermelho { background: var(--vermelho-claro); color: var(--vermelho); }
.badge--verde { background: var(--verde-claro); color: var(--verde); }
.badge--azul { background: var(--azul-claro); color: var(--azul); }
.badge--cinza { background: var(--cinza-claro); color: var(--suave); }
.badge--riscado { background: transparent; color: var(--suave); text-decoration: line-through; }
.texto-vermelho { color: var(--vermelho); font-weight: 650; }
.texto-suave { color: var(--suave); }

/* ---------- Acesso ---------- */
.acesso { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.acesso__lado {
  background: radial-gradient(circle at 20% 10%, rgba(6, 182, 212, .18), transparent 45%), var(--marinho);
  color: #e2e8f0; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
}
.acesso__logo { width: 72px; height: 72px; object-fit: contain; }
.acesso__lado h1 { font-size: 2.3rem; color: #fff; max-width: 14ch; }
.acesso__lado h1 em { font-style: normal; background: var(--gradiente); -webkit-background-clip: text; background-clip: text; color: transparent; }
.acesso__lado p { color: #94a3b8; max-width: 40ch; }
.acesso__lado small { color: #64748b; }
.acesso__form { display: flex; align-items: center; justify-content: center; padding: 2rem 16px; }
.acesso__caixa { width: 100%; max-width: 380px; }
.acesso__caixa h2 { font-size: 1.5rem; }
.acesso__caixa > p { color: var(--suave); margin: .3rem 0 1.5rem; }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.menu {
  background: var(--marinho); color: #cbd5e1; padding: 1.2rem .9rem;
  display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh;
}
.menu__marca { display: flex; align-items: center; gap: .7rem; padding: 0 .4rem; }
.menu__marca img { width: 38px; height: 38px; object-fit: contain; }
.menu__marca strong { display: block; color: #fff; font-size: 1.05rem; }
.menu__marca span { font-size: .78rem; color: #64748b; }
.menu__nav { display: flex; flex-direction: column; gap: .2rem; }
.menu__nav a { color: #cbd5e1; padding: .6rem .8rem; border-radius: 10px; font-weight: 550; }
.menu__nav a:hover { background: var(--marinho-2); text-decoration: none; color: #fff; }
.menu__nav a.ativo { background: var(--marinho-3); color: #fff; box-shadow: inset 3px 0 0 var(--ciano); }
.menu__rodape { margin-top: auto; display: flex; flex-direction: column; gap: .4rem; }
.menu__rodape .btn--fantasma { color: #94a3b8; justify-content: flex-start; }
.menu__rodape .btn--fantasma:hover { background: var(--marinho-2); color: #fff; }
.menu__usuario {
  display: flex; align-items: center; gap: .6rem; padding: .5rem; border-radius: 10px;
  background: transparent; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.menu__usuario:hover { background: var(--marinho-2); }
.menu__usuario strong { display: block; color: #fff; font-size: .9rem; }
.menu__usuario small { color: #64748b; font-size: .78rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--gradiente); color: #fff; font-weight: 700;
}

.conteudo { padding: 2rem 2.2rem 3rem; min-width: 0; display: flex; flex-direction: column; gap: 1.3rem; outline: none; }
.topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.topo p { margin: .3rem 0 0; color: var(--suave); }
.topo h1 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.topo__acoes { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.voltar { display: inline-block; font-size: .88rem; margin-bottom: .4rem; }
.carregando { color: var(--suave); padding: 2rem 0; }
.filtros { display: flex; gap: .6rem; flex-wrap: wrap; }
.filtros .input { width: auto; min-width: 200px; }

/* ---------- Cartões e números ---------- */
.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); padding: 1.1rem 1.2rem; min-width: 0; }
.cartao > h2 { margin-bottom: .8rem; }
.cartao__topo { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.cartao--tabela { overflow-x: auto; }
.grade-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.pre { white-space: pre-wrap; margin: 0; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.kpi {
  background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .2rem; color: inherit;
}
a.kpi:hover { text-decoration: none; border-color: #c7d2fe; }
.kpi span { font-size: .85rem; color: var(--suave); font-weight: 550; }
.kpi strong { font-size: 1.6rem; font-weight: 750; letter-spacing: -.01em; }
.kpi--alerta { border-color: #fecaca; background: #fffafa; }
.kpi--alerta strong { color: var(--vermelho); }
.kpi--destaque { background: var(--marinho); border-color: var(--marinho); }
.kpi--destaque span, .kpi--destaque small { color: #94a3b8; }
.kpi--destaque strong { color: #fff; }

.lista { list-style: none; margin: 0; padding: 0; }
.lista__item { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .65rem 0; border-top: 1px solid var(--borda); }
.lista__item:first-child { border-top: 0; }
.lista__item small { display: block; }
.lista__dir { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.primeira-maiuscula::first-letter { text-transform: uppercase; }

.tabela { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabela th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); font-weight: 650; padding: .5rem .6rem; border-bottom: 1px solid var(--borda); white-space: nowrap; }
.tabela td { padding: .7rem .6rem; border-bottom: 1px solid var(--borda); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela .clicavel { cursor: pointer; }
.tabela .clicavel:hover td { background: #f8faff; }
.tabela__acao { text-align: right; white-space: nowrap; }
.linha--apagada td { color: var(--suave); }

.vazio { text-align: center; padding: 2rem 1rem; color: var(--suave); }
.vazio strong { color: var(--texto); display: block; }
.vazio p { margin: .3rem 0 0; }
.rodape-acao { margin: 0; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.nota-regra { margin: 0; color: var(--suave); font-size: .88rem; }

/* ---------- Quadro de tarefas ---------- */
.quadro { display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: .9rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; }
.coluna { background: #e9edf4; border-radius: var(--raio); padding: .7rem; display: flex; flex-direction: column; gap: .6rem; min-height: 200px; transition: background .15s; }
.coluna--alvo { background: #dbe6fd; }
.coluna__topo { display: flex; justify-content: space-between; align-items: center; padding: 0 .2rem; }
.coluna__topo h2 { font-size: .9rem; }
.coluna__topo span { font-size: .8rem; color: var(--suave); background: #fff; border-radius: 999px; padding: 0 .5rem; }
.coluna__itens { display: flex; flex-direction: column; gap: .55rem; }
.coluna__vazia { margin: 0; text-align: center; color: #94a3b8; font-size: .85rem; padding: 1rem 0; }
.coluna__nota { font-size: .75rem; padding: 0 .2rem; }
.tarefa {
  background: #fff; border: 1px solid var(--borda); border-radius: 10px; padding: .7rem .8rem;
  display: flex; flex-direction: column; gap: .25rem; cursor: pointer; box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.tarefa:hover { border-color: #bfcff7; }
.tarefa.arrastando { opacity: .5; }
.tarefa--atrasada { border-color: #fca5a5; border-left: 4px solid var(--vermelho); }
.tarefa .badge { align-self: flex-start; }
.tarefa strong { font-size: .92rem; }
.tarefa__rodape { display: flex; justify-content: space-between; gap: .5rem; font-size: .8rem; color: var(--suave); margin-top: .2rem; }

/* ---------- Janela e avisos ---------- */
.modal {
  border: 0; border-radius: 16px; padding: 1.6rem; width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(2, 6, 23, .3); color: var(--texto);
}
.modal--largo { width: min(720px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(2, 6, 23, .55); }
.modal h2 { font-size: 1.2rem; margin-bottom: 1rem; padding-right: 2rem; }
.modal__fechar { position: absolute; top: .8rem; right: .8rem; width: 36px; height: 36px; border: 0; background: transparent; font-size: 1.5rem; cursor: pointer; color: var(--suave); border-radius: 8px; }
.modal__fechar:hover { background: var(--cinza-claro); }
.modal__texto { margin: -.4rem 0 1rem; color: var(--suave); }
.modal__acoes { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .4rem; }
.modal__acoes .btn--perigo-texto { margin-right: auto; }

.toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 50; }
.toast { background: var(--marinho); color: #fff; padding: .75rem 1rem; border-radius: 10px; box-shadow: 0 8px 24px rgba(2, 6, 23, .25); max-width: 360px; transition: opacity .4s; }
.toast--erro { background: var(--vermelho); }
.toast--saindo { opacity: 0; }

/* ---------- Celular ---------- */
@media (max-width: 900px) {
  .acesso { grid-template-columns: 1fr; }
  .acesso__lado { padding: 2rem 16px; }
  .acesso__lado h1 { font-size: 1.7rem; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .menu { position: static; height: auto; padding: .8rem 16px; gap: .8rem; }
  .menu__nav { flex-direction: row; overflow-x: auto; }
  .menu__nav a { white-space: nowrap; }
  .menu__nav a.ativo { box-shadow: inset 0 -3px 0 var(--ciano); }
  .menu__rodape { flex-direction: row; justify-content: space-between; align-items: center; margin-top: 0; }
  .conteudo { padding: 1.3rem 16px 2.5rem; }
  .grade-2 { grid-template-columns: 1fr; }
  .form-linha { flex-direction: column; }
  .filtros .input { flex: 1; min-width: 0; }
  .quadro { grid-template-columns: repeat(5, 78vw); scroll-snap-type: x mandatory; }
  .coluna { scroll-snap-align: start; }
  .toasts { left: 16px; right: 16px; }
}

/* ---------- Briefings, reportes, financeiro e configurações ---------- */
.lista-cartoes { display: flex; flex-direction: column; gap: 1rem; }
.ficha { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 0; font-size: .92rem; }
.ficha dt { color: var(--suave); font-weight: 600; }
.ficha dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ficha code, .passos code { font-size: .85rem; background: var(--cinza-claro); padding: .1rem .4rem; border-radius: 6px; overflow-wrap: anywhere; }
.passos { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--borda); display: flex; flex-direction: column; gap: .7rem; }
.passos h3, .subtitulo { font-size: .95rem; margin: 0; }
.passos p { margin: 0; }
.subtitulo { margin-top: 1.4rem; margin-bottom: .6rem; }
.reporte-dia { padding: .8rem 0; border-top: 1px solid var(--borda); }
.reporte-dia:first-of-type { border-top: 0; padding-top: 0; }
.reporte-dia h3 { font-size: .85rem; color: var(--suave); margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .04em; }
.reporte { padding: .6rem .8rem; background: var(--fundo); border-radius: 10px; margin-bottom: .5rem; }
.reporte p { margin: .25rem 0 0; white-space: pre-wrap; }
.reporte p span { color: var(--suave); font-weight: 600; }
.reporte__precisa { color: var(--vermelho); }
.kpi__texto { font-size: 1.05rem !important; line-height: 1.35; }
.texto-verde { color: var(--verde); font-weight: 600; }
.input--mes { width: auto; }
.linha--destaque td { background: var(--azul-claro); }
@media (max-width: 900px) {
  .ficha { grid-template-columns: 1fr; gap: .1rem; }
  .ficha dd { margin-bottom: .5rem; }
}
