/* Leads — complementa /anuncios/app.css */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select {
  min-height: 40px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  padding: 8px 12px; font-size: 14px;
}
.filters input { width: 230px; }
.filters select { max-width: 240px; }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--cyan-ink); box-shadow: 0 0 0 3px rgba(0, 209, 255, .18); }

.kpis { margin-bottom: 20px; }

/* ---------- planilha ---------- */
.sheet { overflow-x: auto; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 1380px; }
.sheet th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  padding: 12px 8px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0;
}
.sheet th:first-child { padding-left: 16px; }
.sheet td { padding: 6px 4px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.sheet td:first-child { padding-left: 12px; }
.sheet tr:last-child td { border-bottom: 0; }
.sheet tr.st-perdido td:not(.c-nota):not(.c-del) { opacity: .55; }
.sheet tr.st-fechado { background: #f6fbf2; }
.sheet tr.is-new { animation: novo 1.6s ease; }
@keyframes novo { from { background: #e0f6fd; } to { background: transparent; } }

.sheet input, .sheet select, .sheet textarea {
  width: 100%; min-height: 38px; border: 1px solid transparent; border-radius: var(--r); background: transparent;
  padding: 7px 8px; font-size: 14px; line-height: 1.4;
}
.sheet select { appearance: none; padding-right: 22px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238594a5' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 7px center;
}
.sheet select:has(option[value=""]:checked) { color: var(--muted-2); }
.sheet textarea { resize: none; overflow: hidden; display: block; }
.sheet tr:hover :is(input, select, textarea) { border-color: var(--line-2); }
.sheet :is(input, select, textarea):focus { outline: none; border-color: var(--cyan-ink); background-color: #fff; box-shadow: 0 0 0 3px rgba(0, 209, 255, .18); }
.sheet input::placeholder, .sheet textarea::placeholder { color: var(--muted-2); }

.c-nota { width: 92px; }
.c-nome { min-width: 190px; }
.c-nome input { font-weight: 600; }
.c-origem { min-width: 230px; }
.c-vidas { width: 76px; }
.c-obs { min-width: 230px; }
.c-del { width: 86px; text-align: right; padding-right: 12px !important; }
.sheet td:nth-child(3) { min-width: 150px; }
.sheet td:nth-child(4) { width: 150px; }
.sheet td:nth-child(6) { min-width: 150px; }
.sheet td:nth-child(7) { min-width: 175px; }
.sheet td:nth-child(8) { min-width: 175px; }
.sheet td:nth-child(10) { min-width: 150px; }
.sheet__none { margin: 0; padding: 24px; text-align: center; color: var(--muted); }

.del { border: 0; background: none; color: var(--muted-2); font-size: 12.5px; font-weight: 600; padding: 10px 6px; border-radius: var(--r); }
.del:hover { color: var(--danger); }
.del.is-confirm { color: #fff; background: var(--danger); padding: 8px 10px; }

/* ---------- nota ---------- */
.nota {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 4px 9px 4px 4px; border-radius: 999px;
  border: 2px solid transparent; font-variant-numeric: tabular-nums; cursor: help;
}
.nota b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.nota span { font-size: 14px; font-weight: 700; }
.nota--A { background: #e9f7e2; color: #23661b; } .nota--A b { background: var(--lime); color: var(--ink); }
.nota--B { background: #e0f6fd; color: #0b5c80; } .nota--B b { background: var(--cyan); color: var(--ink); }
.nota--C { background: #fff2dc; color: #8a5300; } .nota--C b { background: #ffc35c; color: var(--ink); }
.nota--D { background: #f1f3f6; color: var(--muted); } .nota--D b { background: #c9d2dc; color: var(--ink); }
.nota--parcial { background: transparent; border-style: dashed; border-color: currentColor; }
.falta { display: block; margin-top: 3px; font-size: 10.5px; line-height: 1.25; color: var(--muted-2); max-width: 86px; }

/* ---------- rodapé ---------- */
.savestate { font-size: 12.5px; color: var(--ok); font-weight: 600; }
.savestate.is-busy { color: var(--muted); }

/* ---------- regras ---------- */
.drawer__panel { width: min(560px, 100%); }
.rules { padding: 26px 28px 40px; }
.rules__head { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 4px 12px; }
.rules__head .eyebrow { grid-column: 1; }
.rules__head h2 { grid-column: 1; margin: 2px 0 0; font-size: 24px; }
.rules__head .btn { grid-column: 2; grid-row: 1 / span 2; }
.rules p { color: var(--muted); font-size: 14px; }
.rules h3 { margin: 26px 0 10px; font-size: 15px; }
.rules__hint { font-size: 12.5px !important; }
.letras { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.letras li { display: flex; align-items: center; gap: 10px; }
.letras .nota { margin: 0; padding: 0; cursor: default; }
.origens { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); }
.origens li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.origens li:first-child { border-top: 0; }
.origens small { display: block; color: var(--muted-2); font-size: 11.5px; }
.origens select { min-height: 36px; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 8px; font-size: 13px; max-width: 220px; }
.origens b { font-size: 13px; text-align: right; }
.perfil { border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 10px; }
.perfil summary { cursor: pointer; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.perfil summary b { font-size: 14px; }
.perfil summary span { font-size: 12.5px; color: var(--muted); }
.perfil__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; padding: 0 14px 14px; }
.perfil h4 { margin: 8px 0 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.perfil ul { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.perfil li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dotted var(--line-2); }
.perfil li b { font-variant-numeric: tabular-nums; }

/* ---------- celular: cada lead vira um cartão ---------- */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .viewbar { position: static; }
  .filters { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .filters input { width: 100%; grid-column: 1 / -1; font-size: 16px; }
  .filters select { max-width: none; width: 100%; font-size: 16px; }
  .viewbar__right { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .viewbar__right #btnNovo { grid-column: 1 / -1; grid-row: 1; min-height: 48px; }
  .viewbar__right .btn { white-space: normal; font-size: 13px; }
  .intro h1 { font-size: 26px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis .kpi:nth-child(3) { border-left: 0; }
  .kpis .kpi:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .kpi__v { font-size: 24px; }

  .sheet { overflow: visible; background: none; border: 0; box-shadow: none; }
  .sheet table, .sheet tbody { display: block; min-width: 0; }
  .sheet thead { display: none; }
  .sheet tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-bottom: 12px; padding: 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  }
  .sheet tr.st-fechado { background: #f6fbf2; }
  .sheet td { display: block; padding: 0 !important; border: 0; min-width: 0 !important; width: auto !important; }
  .sheet td::before { content: attr(data-th); display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 2px 2px; }
  .sheet td.c-nota::before, .sheet td.c-del::before { content: none; }
  .sheet :is(input, select, textarea) { font-size: 16px; min-height: 44px; border-color: var(--line-2); background-color: var(--surface-2); }
  .c-nota { grid-column: 1; grid-row: 1; display: flex !important; align-items: center; gap: 8px; }
  .c-nota .nota { margin: 0; }
  .falta { max-width: none; }
  .c-del { grid-column: 2; grid-row: 1; text-align: right; }
  .c-nome, .c-origem, .c-obs { grid-column: 1 / -1; }
  .c-nome input { font-size: 17px; }
  .perfil__grid { grid-template-columns: 1fr; }
  .rules { padding: 22px 18px 36px; }
}
