:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0efe9;
  --line: #e2e0d8;
  --text: #1d1f1c;
  --muted: #6b6e66;
  --accent: #1f6f5c;
  --accent-soft: #e2efe9;
  --good: #1f7a4d;   --good-bg: #e1f2e8;
  --mid: #9a6a00;    --mid-bg: #fbefd3;
  --low: #8a8d85;    --low-bg: #ecebe6;
  --bad: #b3372b;    --bad-bg: #f8e3df;
  --info: #2c5d9e;   --info-bg: #e3ecf8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 22, 18, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141614; --surface: #1c1f1c; --surface-2: #242823; --line: #30352f;
    --text: #e9ebe6; --muted: #9da298; --accent: #5cc3a3; --accent-soft: #1f3a32;
    --good: #6fd29c; --good-bg: #1d3a2a; --mid: #e8b84e; --mid-bg: #3a3020;
    --low: #9da298; --low-bg: #2a2e29; --bad: #f08a7c; --bad-bg: #3d2421;
    --info: #8cb3ea; --info-bg: #1f2c3f;
    --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.02rem; }
h3 { font-size: 1rem; }
p { margin: .4rem 0; }
code, .mono, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1.4rem; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 64px; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-inner { display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 18px; height: 18px; border-radius: 5px; background: var(--accent); display: inline-block; position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.brand.big { font-size: 1.05rem; margin-bottom: 18px; }
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.on { color: var(--text); background: var(--surface-2); }
.logout { margin: 0; }

/* layout */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .muted { max-width: 680px; }
.eyebrow { color: var(--muted); font-size: .85rem; margin: 0 0 4px; text-transform: lowercase; }
.eyebrow a { color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row form { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.grid2.wide-left { grid-template-columns: 1.4fr 1fr; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 820px) { .grid2, .grid2.wide-left, .row2 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.flush { padding: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.card-head a { font-size: .86rem; white-space: nowrap; }
.card.empty { text-align: center; padding: 36px 18px; }
.list-label { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }

/* forms */
label { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; color: var(--muted); font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.four { grid-template-columns: 2fr 2fr 1fr 1fr; }
.form-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid, .form-grid.four { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline { margin: 0; }
.inline-label { flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
.inline-label select { width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .9rem;
  padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0e1a16; } }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: .82rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 6px; }
.link:hover { color: var(--text); }
.link.danger { color: var(--bad); }
.danger-zone { margin: -4px 0 16px; text-align: right; }
.bookmarklet { cursor: grab; border-style: dashed; }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; background: var(--good-bg); color: var(--good); font-weight: 500; }
.flash.error { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--mid-bg); color: var(--mid); }
.flash pre { margin-top: 8px; color: var(--text); }

/* auth */
main.bare { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth { width: 100%; max-width: 380px; }
.auth h1 { font-size: 1.3rem; margin-bottom: 6px; }
.auth form { margin-top: 16px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.stat .k { font-size: .8rem; color: var(--muted); }
.stat .v { font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: .95rem; color: var(--muted); font-weight: 500; }
.stat .s { font-size: .78rem; color: var(--muted); }
.bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* checklists */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist li form { margin: 0; }
.checklist li.done span { color: var(--muted); text-decoration: line-through; }
.checklist li.routine > span { color: var(--muted); }
.check { width: 20px; height: 20px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--surface); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; flex-shrink: 0; margin-top: 1px; padding: 0; }
.check:hover { border-color: var(--accent); }
li.done .check { background: var(--accent); border-color: var(--accent); }
.checklist.editable .task { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); font-size: .95rem; font-weight: 400; flex: 1; cursor: pointer; }
.checklist.editable .task input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; }
.checklist .del { flex-direction: row; align-items: center; gap: 4px; font-size: .74rem; opacity: 0; transition: opacity .15s; cursor: pointer; }
.checklist li:hover .del, .del:has(input:checked) { opacity: 1; }
.del:has(input:checked) { color: var(--bad); }

/* rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; flex-direction: column; gap: 2px; padding: 9px 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows li.lead-row { flex-direction: row; align-items: center; gap: 12px; }

/* funnel */
.funnel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.funnel-item { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: .86rem; }
.funnel-item:hover { text-decoration: none; filter: brightness(.97); }
.funnel-item b { font-variant-numeric: tabular-nums; }

/* status colors */
.st-aplicada { --c: var(--info); --cb: var(--info-bg); }
.st-triagem, .st-tecnica, .st-final { --c: var(--mid); --cb: var(--mid-bg); }
.st-oferta { --c: var(--good); --cb: var(--good-bg); }
.st-recusada { --c: var(--bad); --cb: var(--bad-bg); }
.st-sem_resposta, .st-desisti, .st-interesse { --c: var(--low); --cb: var(--low-bg); }
.funnel-item[class*=st-] { background: var(--cb); color: var(--c); }
.status-select { width: auto; font-size: .82rem; font-weight: 600; padding: 4px 8px; background: var(--cb, var(--surface)); color: var(--c, var(--text)); border-color: transparent; }

/* filters / chips */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { max-width: 280px; margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .84rem; font-weight: 500; }
.chip b { color: var(--text); margin-left: 3px; font-weight: 600; }
.chip:hover { text-decoration: none; color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.on b { color: var(--bg); }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .late { color: var(--bad); font-weight: 500; }
.table pre.log { font-size: .78rem; color: var(--muted); }

/* score + tags */
.score { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 6px; border-radius: 10px; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.table .score { min-width: 30px; height: 26px; border-radius: 7px; font-size: .85rem; }
.score.good { background: var(--good-bg); color: var(--good); }
.score.mid { background: var(--mid-bg); color: var(--mid); }
.score.low { background: var(--low-bg); color: var(--low); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.tag { display: inline-block; font-size: .76rem; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-weight: 500; }
.tag.have { background: var(--accent-soft); color: var(--accent); }
.tag.gap { background: var(--mid-bg); color: var(--mid); }
.salary { color: var(--good); font-weight: 600; }

/* leads */
.lead { padding: 16px 18px; }
.lead-top { display: flex; gap: 14px; align-items: flex-start; }
.lead-title h3 { color: var(--text); }
.lead-title a:hover h3 { color: var(--accent); }
.lead details summary { cursor: pointer; color: var(--muted); font-size: .88rem; list-style: none; }
.lead details summary::-webkit-details-marker { display: none; }
.lead details summary::after { content: "  ver mais"; color: var(--accent); font-weight: 500; }
.lead details[open] summary::after { content: "  fechar"; }
.desc { margin-top: 10px; font-size: .9rem; max-height: 480px; overflow: auto; padding: 12px; background: var(--surface-2); border-radius: 8px; }
.lead-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.lead-actions form { margin: 0; }
details.card > summary { cursor: pointer; font-weight: 600; }

/* skills */
.table.skills td { vertical-align: middle; }
.table.skills tr.lv-0 td:first-child strong { color: var(--muted); }
.pattern summary { cursor: pointer; list-style: none; }
.pattern input { margin-top: 4px; font-size: .78rem; }
.weight { display: flex; gap: 2px; margin-top: 4px; }
.weight i { width: 8px; height: 4px; border-radius: 2px; background: var(--line); }
.weight i.on { background: var(--accent); }
.levels { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.lvl { flex-direction: row; cursor: pointer; }
.lvl input { position: absolute; opacity: 0; pointer-events: none; }
.lvl span { padding: 5px 9px; font-size: .78rem; color: var(--muted); border-left: 1px solid var(--line); white-space: nowrap; }
.lvl:first-child span { border-left: 0; }
.lvl input:checked + span { background: var(--accent); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .lvl input:checked + span { color: #0e1a16; } }
.lvl input:focus-visible + span { outline: 2px solid var(--accent); }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 40%); display: flex; justify-content: flex-end; }

/* plan */
.week { margin-bottom: 26px; }
.week h2 { font-size: 1rem; margin-bottom: 10px; font-weight: 600; }
.wk { display: inline-block; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 6px; margin-right: 6px; vertical-align: 1px; }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.day { display: flex; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.day:hover { text-decoration: none; border-color: var(--accent); }
.day-date { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 44px; padding: 4px; border-radius: 8px; background: var(--surface-2); }
.day-date span { font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.day-date b { font-size: .95rem; font-variant-numeric: tabular-nums; }
.day-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.day-body strong { font-size: .9rem; font-weight: 600; line-height: 1.3; }
.day.optional { border-style: dashed; background: transparent; }
.day.optional .day-body strong { color: var(--muted); }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.day.today .day-date { background: var(--accent); }
.day.today .day-date span, .day.today .day-date b { color: #fff; }
.day.complete .bar i { background: var(--good); }
.day.behind .bar i { background: var(--mid); }
.day.behind .day-date { background: var(--mid-bg); }
.sent-box { background: var(--surface-2); border-radius: 10px; padding: 12px; font-size: .9rem; }
.sent-box b { font-size: 1.2rem; }
.sent-box ul { margin: 6px 0; padding-left: 18px; }

pre.copy { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: copy; position: relative; }
pre.copy:hover::after { content: "copiar"; position: absolute; right: 8px; top: 8px; font-size: .7rem; color: var(--muted); }
pre.copy.copied::after { content: "copiado ✓"; }
