/* Painel de Chamados - Tecnologia | GRUPO FAJ */

:root {
  --azul: #0f3460;
  --azul-claro: #1a5490;
  --acento: #e94560;
  --ok: #2f9e44;
  --alerta: #f08c00;
  --info: #0e7490;
  --texto: #1a202c;
  --texto-fraco: #64748b;
  --borda: #e2e8f0;
  --fundo: #f1f5f9;
  --branco: #fff;
  --raio: 10px;
  --sombra: 0 1px 3px rgba(15,52,96,.08), 0 4px 14px rgba(15,52,96,.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--fundo); color: var(--texto); line-height: 1.5; font-size: 14px;
}
.oculto { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* -------------------------------------------------------------- login */
.tela-login {
  position: fixed; inset: 0; display: flex; align-items: center;
  justify-content: center; padding: 20px;
  background: linear-gradient(135deg, var(--azul), var(--azul-claro));
}
.login-caixa {
  background: var(--branco); border-radius: 14px; padding: 42px 36px;
  max-width: 400px; width: 100%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-caixa h1 { font-size: 1.35rem; margin: 16px 0 6px; }
.login-caixa p { color: var(--texto-fraco); margin-bottom: 26px; }
.marca-logo {
  display: inline-block; background: var(--azul); color: var(--branco);
  padding: 10px 16px; border-radius: 10px; font-weight: 700; letter-spacing: 1px;
}
.btn-ms {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px; border: 1px solid var(--borda); border-radius: 8px;
  background: var(--branco); font-size: .95rem; font-weight: 600;
  transition: background .15s, border-color .15s;
}
.btn-ms:hover { background: var(--fundo); border-color: var(--azul-claro); }
.login-erro { color: var(--acento); font-size: .85rem; margin-top: 16px; min-height: 20px; }

/* --------------------------------------------------------------- topo */
.topo {
  background: linear-gradient(135deg, var(--azul), var(--azul-claro));
  color: var(--branco); padding: 14px 0;
}
.topo-inner {
  max-width: 1800px; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.marca { display: flex; align-items: center; gap: 12px; }
.marca .marca-logo {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
  padding: 7px 11px; font-size: .85rem;
}
.topo h1 { font-size: 1.05rem; font-weight: 600; }
.topo p { font-size: .78rem; opacity: .85; }
.topo-direita { display: flex; align-items: center; gap: 14px; }
.usuario { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.usuario-nome { font-size: .85rem; font-weight: 600; }
.badge-papel {
  font-size: .65rem; font-weight: 700; letter-spacing: .05em;
  padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.2);
}
.badge-admin { background: var(--acento); }
.badge-executor { background: var(--info); }
.btn-ghost {
  background: rgba(255,255,255,.14); color: var(--branco);
  border: 1px solid rgba(255,255,255,.3); padding: 8px 14px;
  border-radius: 7px; font-size: .82rem; font-weight: 600;
}
.btn-ghost:hover { background: rgba(255,255,255,.24); }

/* -------------------------------------------------------- indicadores */
.indicadores {
  max-width: 1800px; margin: 18px auto 0; padding: 0 22px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
}
.indicador {
  background: var(--branco); border-radius: var(--raio); padding: 14px 16px;
  box-shadow: var(--sombra); border-left: 3px solid var(--borda);
  display: flex; flex-direction: column;
}
.indicador-valor { font-size: 1.6rem; font-weight: 700; color: var(--azul); }
.indicador-rotulo { font-size: .78rem; color: var(--texto-fraco); }
.indicador-alerta { border-left-color: var(--alerta); }
.indicador-alerta .indicador-valor { color: var(--alerta); }
.indicador-erro { border-left-color: var(--acento); }
.indicador-erro .indicador-valor { color: var(--acento); }
.indicador-ok { border-left-color: var(--ok); }
.indicador-ok .indicador-valor { color: var(--ok); }
.indicador-info { border-left-color: var(--info); }
.indicador-info .indicador-valor { color: var(--info); }

/* ------------------------------------------------------------ filtros */
.filtros {
  max-width: 1800px; margin: 16px auto; padding: 0 22px;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.filtro-busca {
  flex: 1; min-width: 260px; padding: 10px 14px;
  border: 1px solid var(--borda); border-radius: 8px; font-size: .9rem;
}
.filtro-select {
  padding: 10px 12px; border: 1px solid var(--borda); border-radius: 8px;
  font-size: .9rem; background: var(--branco); min-width: 190px;
}
.filtro-busca:focus, .filtro-select:focus {
  outline: none; border-color: var(--azul-claro);
  box-shadow: 0 0 0 3px rgba(26,84,144,.12);
}
.btn-secundario, .btn-primario, .btn-ok, .btn-erro {
  padding: 10px 18px; border: 0; border-radius: 8px;
  font-size: .88rem; font-weight: 600; transition: opacity .15s, background .15s;
}
.btn-secundario { background: var(--branco); border: 1px solid var(--borda); color: var(--texto); }
.btn-secundario:hover { background: var(--fundo); }
.btn-primario { background: var(--azul); color: var(--branco); }
.btn-primario:hover { background: var(--azul-claro); }
.btn-ok { background: var(--ok); color: var(--branco); }
.btn-erro { background: var(--acento); color: var(--branco); }
.btn-ok:hover, .btn-erro:hover { opacity: .88; }

/* ------------------------------------------------------------- kanban */
.kanban {
  max-width: 1800px; margin: 0 auto; padding: 0 22px 40px;
  display: flex; gap: 14px; overflow-x: auto; align-items: flex-start;
}
.coluna {
  flex: 0 0 258px; background: #e8edf3; border-radius: var(--raio);
  max-height: calc(100vh - 260px); display: flex; flex-direction: column;
}
.coluna-topo {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid #d8e0ea;
}
.coluna-topo h2 {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--azul);
}
.coluna-contador {
  background: var(--branco); color: var(--texto-fraco);
  padding: 1px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700;
}
.coluna-corpo {
  padding: 10px; display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; min-height: 90px;
}
.coluna-corpo.sobre { background: #dbeafe; outline: 2px dashed var(--azul-claro); }
.coluna-vazia { color: var(--texto-fraco); font-size: .8rem; text-align: center; padding: 18px 0; }

.cartao {
  background: var(--branco); border-radius: 8px; padding: 12px;
  box-shadow: var(--sombra); cursor: pointer; border-left: 3px solid transparent;
  transition: transform .1s, box-shadow .15s;
}
.cartao:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,52,96,.14); }
.cartao.arrastando { opacity: .45; }
.cartao.atrasado { border-left-color: var(--acento); }
.cartao.prio-critica { border-left-color: var(--acento); }
.cartao.prio-alta { border-left-color: var(--alerta); }

.cartao-topo { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.cartao-protocolo {
  font-family: Consolas, monospace; font-size: .72rem;
  font-weight: 700; color: var(--azul-claro);
}
.tag-atraso {
  background: #fee2e2; color: #991b1b; font-size: .64rem; font-weight: 700;
  padding: 1px 6px; border-radius: 4px; text-transform: uppercase;
}
.cartao-titulo {
  font-size: .88rem; font-weight: 600; margin: 6px 0 8px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cartao-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.tag {
  font-size: .68rem; padding: 2px 7px; border-radius: 4px;
  background: var(--fundo); color: var(--texto-fraco); font-weight: 600;
}
.tag-cat { background: #e0e7ff; color: #3730a3; }
.tag-pendente { background: #fef3c7; color: #92400e; }
.cartao-rodape {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: .72rem; color: var(--texto-fraco);
  border-top: 1px solid var(--borda); padding-top: 7px;
}
.cartao-icones { white-space: nowrap; }
.cartao-responsavel {
  display: flex; align-items: center; gap: 6px;
  margin-top: 7px; font-size: .74rem; color: var(--texto);
}
.avatar {
  width: 20px; height: 20px; border-radius: 50%; background: var(--azul);
  color: var(--branco); display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700;
}
.sem-resp { color: var(--texto-fraco); font-style: italic; }
.carregando { padding: 40px; text-align: center; color: var(--texto-fraco); }

/* ------------------------------------------------------------- drawer */
.drawer { position: fixed; inset: 0; z-index: 200; }
.drawer-fundo { position: absolute; inset: 0; background: rgba(15,23,42,.5); }
.drawer-caixa {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(680px, 100%);
  background: var(--branco); box-shadow: -8px 0 30px rgba(0,0,0,.2);
  display: flex; flex-direction: column; animation: entrar .18s ease-out;
}
@keyframes entrar { from { transform: translateX(24px); opacity: .6; } }
.drawer-topo {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid var(--borda); flex-wrap: wrap;
}
.drawer-protocolo {
  font-family: Consolas, monospace; font-weight: 700;
  color: var(--azul); margin-right: 8px;
}
.drawer-fechar {
  border: 0; background: transparent; font-size: 1.7rem;
  line-height: 1; color: var(--texto-fraco);
}
.drawer-corpo { padding: 22px; overflow-y: auto; }

.d-titulo { font-size: 1.15rem; margin-bottom: 16px; }
.d-grid { display: grid; gap: 2px; margin-bottom: 20px; }
.d-linha {
  display: grid; grid-template-columns: 150px 1fr; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--borda); font-size: .85rem;
}
.d-linha span { color: var(--texto-fraco); }
.txt-erro { color: var(--acento); }

.d-secao { margin-bottom: 24px; }
.d-secao h3 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--azul); margin-bottom: 10px; font-weight: 700;
}
.d-descricao {
  background: var(--fundo); padding: 14px; border-radius: 8px; font-size: .88rem;
}
.d-descricao p { margin-bottom: 6px; }

.anexos-grade {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px;
}
.anexo-card {
  border: 1px solid var(--borda); border-radius: 8px; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.anexo-thumb, .anexo-video {
  width: 100%; height: 110px; object-fit: cover; border-radius: 6px; background: #000;
}
.anexo-doc {
  height: 110px; display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; background: var(--fundo); border-radius: 6px;
}
.anexo-info { display: flex; flex-direction: column; font-size: .76rem; }
.anexo-nome { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anexo-tamanho { color: var(--texto-fraco); }
.btn-baixar {
  text-align: center; background: var(--azul); color: var(--branco);
  padding: 6px; border-radius: 6px; font-size: .78rem;
  font-weight: 600; text-decoration: none;
}
.btn-baixar:hover { background: var(--azul-claro); }

.d-decisao { background: #f8fafc; border: 1px solid var(--borda); border-radius: 8px; padding: 16px; }
.d-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 12px; }
.d-form label { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; font-weight: 600; }
.d-form select, .d-form input[type="date"] {
  padding: 8px 10px; border: 1px solid var(--borda); border-radius: 7px;
  font-size: .86rem; font-family: inherit; font-weight: 400;
}
.d-textarea {
  width: 100%; min-height: 76px; margin-top: 12px; padding: 10px 12px;
  border: 1px solid var(--borda); border-radius: 8px;
  font-family: inherit; font-size: .88rem; resize: vertical;
}
.d-acoes { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 7px; font-size: .8rem; margin-top: 8px; }

.obs-lista { display: grid; gap: 10px; }
.obs { padding: 11px 13px; border-radius: 8px; border-left: 3px solid var(--borda); background: var(--fundo); }
.obs-interna { border-left-color: var(--alerta); }
.obs-publica { border-left-color: var(--ok); }
.obs-topo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .78rem; margin-bottom: 4px; }
.obs-tag { background: var(--branco); padding: 1px 7px; border-radius: 4px; font-size: .68rem; color: var(--texto-fraco); }
.obs-data { color: var(--texto-fraco); margin-left: auto; }
.obs p { font-size: .86rem; white-space: pre-wrap; }
.vazio { color: var(--texto-fraco); font-size: .84rem; }

.historico { list-style: none; display: grid; gap: 7px; }
.historico li {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
  font-size: .78rem; padding: 7px 0; border-bottom: 1px solid var(--borda);
}
.hist-data { color: var(--texto-fraco); font-family: Consolas, monospace; font-size: .72rem; }
.hist-acao { font-weight: 700; color: var(--azul); }
.hist-mudanca { color: var(--texto-fraco); }
.hist-obs { flex-basis: 100%; color: var(--texto-fraco); font-style: italic; }

/* --------------------------------------------------------------- pills */
.pill { padding: 3px 10px; border-radius: 999px; font-size: .73rem; font-weight: 700; }
.pill-recebido { background: #e0e7ff; color: #3730a3; }
.pill-em_analise { background: #fef3c7; color: #92400e; }
.pill-aprovado { background: #dbeafe; color: #1e40af; }
.pill-escopo_inicial { background: #e0f2fe; color: #075985; }
.pill-frontend { background: #cffafe; color: #0e7490; }
.pill-validacao_setor { background: #fef9c3; color: #854d0e; }
.pill-integracao_base { background: #ede9fe; color: #5b21b6; }
.pill-backend { background: #d1fae5; color: #065f46; }
.pill-teste { background: #ffedd5; color: #9a3412; }
.pill-validacao { background: #fae8ff; color: #86198f; }
.pill-aprovacao_entrega { background: #dcfce7; color: #15803d; }
.pill-em_desenvolvimento { background: #cffafe; color: #0e7490; }
.pill-em_homologacao { background: #f3e8ff; color: #6b21a8; }
.pill-concluido { background: #dcfce7; color: #166534; }
.pill-reprovado { background: #fee2e2; color: #991b1b; }
.pill-cancelado { background: #e5e7eb; color: #4b5563; }
.aprov-pendente { background: #fef3c7; color: #92400e; }
.aprov-aprovado { background: #dcfce7; color: #166534; }
.aprov-reprovado { background: #fee2e2; color: #991b1b; }

/* --------------------------------------------------------------- toast */
.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 300;
  padding: 13px 20px; border-radius: 9px; color: var(--branco);
  font-size: .88rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.22);
  max-width: 420px;
}
.toast-ok { background: var(--ok); }
.toast-erro { background: var(--acento); }

@media (max-width: 720px) {
  .coluna { flex-basis: 82vw; }
  .d-linha { grid-template-columns: 1fr; gap: 2px; }
}
