/* Portal GSN — identidade Flyon (azul-marinho + amarelo) */
:root {
  --navy: #0a1730;
  --navy-2: #0f1f3d;
  --navy-3: #18294a;
  --yellow: #ffd54a;
  --yellow-deep: #ffc022;
  --blue: #4d9bff;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --line: #e3e7ef;
  --ink: #0f1b33;
  --ink-2: #44526b;
  --ink-3: #7b879c;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(10, 23, 48, .06), 0 2px 8px rgba(10, 23, 48, .05);
  --shadow-lg: 0 20px 50px rgba(10, 23, 48, .25);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: #1d5fd1; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── marca ── */
.logo-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--yellow); color: var(--navy); font-weight: 800; font-size: 20px; flex: none; }

/* ── botões ── */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 9px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c9d1de; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.btn-primary:hover { background: var(--yellow-deep); border-color: var(--yellow-deep); }
.btn-danger { color: var(--red); }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-block { width: 100%; justify-content: center; padding: 11px; }

/* ── login ── */
.login-body { background: radial-gradient(1200px 600px at 80% -10%, #1b3466 0%, transparent 60%), var(--navy); color: #e8eef8; display: grid; place-items: center; padding: 24px 16px; min-height: 100%; }
.login-wrap { width: 100%; max-width: 380px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-title { font-weight: 800; font-size: 18px; }
.login-sub { color: #98a8c4; font-size: 13px; }
.login-card { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 26px; box-shadow: var(--shadow-lg); border-top: 4px solid var(--yellow); }
.login-card h1 { margin: 0 0 18px; font-size: 20px; }
.login-card label { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 14px; }
.login-card input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.login-card input:focus, .field input:focus, .field select:focus, .field textarea:focus, .filtro select:focus { outline: 2px solid var(--yellow); outline-offset: 0; border-color: var(--yellow-deep); }
.login-erro { color: var(--red); min-height: 18px; margin: 0 0 10px; font-size: 13px; }
.login-foot { color: #6b7d9e; font-size: 12px; text-align: center; margin-top: 18px; }

/* ── shell ── */
.shell { display: flex; min-height: 100vh; }
.side { width: 236px; flex: none; background: var(--navy); color: #c9d4e6; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.side-title { color: #fff; font-weight: 800; font-size: 17px; letter-spacing: .02em; }
.side-sub { font-size: 12px; color: #8596b3; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: #c9d4e6; text-decoration: none; font-weight: 500; }
.side-nav a:hover { background: var(--navy-2); color: #fff; }
.side-nav a.ativo { background: var(--navy-3); color: #fff; box-shadow: inset 3px 0 0 var(--yellow); }
.side-nav a.ativo svg { color: var(--yellow); }
.side-foot { margin-top: auto; padding: 8px; display: flex; align-items: center; justify-content: space-between; }
.side-sair { background: none; border: 1px solid var(--navy-3); color: #c9d4e6; border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.side-sair:hover { color: #fff; border-color: #2d4473; }
.side-flyon { font-size: 12px; color: #6b7d9e; }
.side-flyon b { color: var(--yellow); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 18px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top h1 { font-size: 19px; margin: 0; flex: 1; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }
.view { padding: 22px 28px 40px; flex: 1; min-width: 0; }

/* ── kanban ── */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: #e9edf4; border-radius: var(--radius); padding: 10px; min-height: 220px; display: flex; flex-direction: column; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; }
.col-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.col-head .count { margin-left: auto; background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 99px; }
.col-list { display: flex; flex-direction: column; gap: 9px; flex: 1; min-height: 120px; border-radius: 9px; transition: background .15s; }
.col-list.alvo { background: rgba(255, 213, 74, .25); outline: 2px dashed var(--yellow-deep); outline-offset: 2px; }
.col-vazia { color: var(--ink-3); font-size: 13px; text-align: center; padding: 26px 8px; }
.card { background: var(--surface); border-radius: 10px; padding: 12px; box-shadow: var(--shadow); cursor: pointer; border: 1px solid transparent; border-left: 4px solid #cfd6e2; }
.card:hover { border-color: #c9d1de; border-left-color: inherit; }
.card.tag-verde { border-left-color: var(--green); }
.card.tag-amarela { border-left-color: var(--yellow-deep); }
.card.arrastando { opacity: .45; }
.card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; color: var(--ink-3); }
.card-top .cod { font-weight: 600; color: var(--ink-2); }
.card-nome { font-weight: 650; font-size: 14px; margin-bottom: 9px; }
.card-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.card-nums div { background: #f5f7fb; border-radius: 7px; padding: 5px 7px; }
.card-nums span { display: block; font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; }
.card-nums b { font-size: 13px; }
.neg { color: var(--red); }
.pos { color: var(--green); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag-v { background: var(--green-soft); color: #15803d; }
.tag-a { background: var(--amber-soft); color: var(--amber); }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; color: var(--ink-2); font-size: 13px; margin-bottom: 14px; }

/* ── modal ── */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 23, 48, .55); }
.modal-box { position: relative; background: var(--surface); border-radius: 16px; width: min(880px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); }
.m-head { position: sticky; top: 0; background: var(--surface); z-index: 2; display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--line); }
.m-head h2 { margin: 0; font-size: 18px; flex: 1; }
.m-head .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; font-weight: 500; }
.m-x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-3); padding: 2px 6px; }
.m-body { padding: 18px 24px 8px; }
.m-foot { position: sticky; bottom: 0; background: var(--surface); display: flex; gap: 8px; align-items: center; padding: 14px 24px; border-top: 1px solid var(--line); }
.m-foot .esp { flex: 1; }
.sec { margin-bottom: 22px; }
.sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 10px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid .s2 { grid-column: span 2; }
.grid .s4 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.field input, .field select, .field textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; font-weight: 400; color: var(--ink); width: 100%; }
.field textarea { resize: vertical; min-height: 70px; }
.field .link { font-weight: 400; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etapa { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 9px; }
.etapa-h { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.etapa-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: var(--yellow); font-weight: 800; font-size: 12px; flex: none; }
.etapa-h input { flex: 1; border: 0; font-weight: 650; padding: 4px; background: transparent; min-width: 0; }
.etapa-h select { border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; background: #fbfcfe; }
.etapa textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; resize: vertical; min-height: 54px; background: #fbfcfe; }
.resumo-box textarea { min-height: 120px; background: #fffbea; border-color: #f5e3a3; }
.confirma { display: flex; align-items: center; gap: 8px; color: var(--red); font-weight: 600; font-size: 13px; }

/* ── pesquisa ── */
.filtro { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; box-shadow: var(--shadow); }
.filtro label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.filtro select { min-width: 220px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.painel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px; }
.painel h2 { margin: 0 0 4px; font-size: 18px; }
.painel h3 { margin: 0 0 12px; font-size: 15px; }
.meta { display: flex; gap: 22px; flex-wrap: wrap; color: var(--ink-2); font-size: 13px; margin: 10px 0 2px; }
.meta b { color: var(--ink); }
.links { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.links a { font-weight: 600; text-decoration: none; }
.links a:hover { text-decoration: underline; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 14px 16px; }
.kpi span { font-size: 12px; color: #98a8c4; }
.kpi b { display: block; font-size: 26px; font-weight: 800; color: var(--yellow); margin-top: 2px; }
.kpi small { color: #c9d4e6; font-size: 12px; }
.funil-row { display: grid; grid-template-columns: 210px 1fr 110px; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.funil-row:last-child { border-bottom: 0; }
.funil-row .et { color: var(--ink-3); font-size: 11.5px; }
.barra { height: 10px; background: #edf0f5; border-radius: 99px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--yellow-deep); border-radius: 99px; }
.funil-row .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.texto p { margin: 0 0 10px; color: var(--ink-2); }
.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid #eef1f6; vertical-align: top; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .motivo { color: var(--ink-3); font-size: 12px; margin-top: 3px; max-width: 520px; }
.sem { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.sem-TESTAR { background: var(--green-soft); color: #15803d; }
.sem-NEGOCIAR { background: var(--amber-soft); color: var(--amber); }
.sem-DESCARTAR { background: var(--red-soft); color: var(--red); }
.sem-BUSCAR { background: #e8eef9; color: #1e4a9a; }
.vazio { text-align: center; color: var(--ink-3); padding: 50px 16px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 60; font-weight: 500; }
.toast.erro { background: var(--red); }

/* ── celular ── */
@media (max-width: 900px) {
  .side { position: fixed; z-index: 40; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.aberto { transform: none; }
  .menu-btn { display: block; }
  .top { padding: 12px 16px; }
  .top h1 { font-size: 16px; }
  .view { padding: 16px 16px 32px; }
  .board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .funil-row { grid-template-columns: 1fr 70px; }
  .funil-row .barra { grid-column: 1 / -1; grid-row: 2; }
  .filtro select { min-width: 0; width: 100%; }
  .filtro label { flex: 1 1 100%; }
  .m-head, .m-body, .m-foot { padding-left: 16px; padding-right: 16px; }
}
