/* Sistema visual do Faro Remoto: neutro, um tom de destaque, cor só para estado. Quatro tamanhos (20/16/14/12), dois pesos. */
:root {
  color-scheme: light dark;
  --bg: #f6f6f4; --card: #fff; --soft: #efefec; --ink: #1c1c1a; --mut: #62625d; --line: #deded9;
  --acc: #c2410c; --acc-ink: #fff; --acc-soft: #fdeee6;
  --warn: #8a5a00; --warn-bg: #fff4d6; --err: #b3261e; --err-bg: #fde8e6; --ok: #1b6b3a; --ok-bg: #e3f4e9;
  --r: 8px; --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .18);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615; --card: #20201e; --soft: #2a2a27; --ink: #ecece8; --mut: #a3a39c; --line: #383835;
    --acc: #f08a5d; --acc-ink: #1a0e07; --acc-soft: #3a2519;
    --warn: #f0c14b; --warn-bg: #3a2f10; --err: #ff8a80; --err-bg: #3d1a17; --ok: #7fd49c; --ok-bg: #16301f;
    --shadow: 0 8px 30px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 20px; font-weight: 600; margin: 0; }
h2, h3 { font-size: 16px; font-weight: 600; margin: 0; }
a { color: var(--acc); }
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mut { color: var(--mut); }
.small { font-size: 12px; }
.b { font-weight: 600; }

/* Navegação */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 1200px; margin: 0 auto; padding: 0 var(--s4); display: flex; align-items: center; gap: var(--s4); min-height: 52px; }
.brand { white-space: nowrap; font-size: 16px; font-weight: 600; color: var(--ink); text-decoration: none; margin-right: var(--s2); }
.topbar nav { display: flex; gap: var(--s1); align-items: center; flex: 1; }
.topbar nav a { padding: var(--s2) var(--s3); border-radius: var(--r); color: var(--mut); text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
.topbar nav a:hover { background: var(--soft); color: var(--ink); }
.topbar nav a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px var(--acc); border-radius: 0; }
.menu { position: relative; }
.menu > button { min-height: 36px; }
.menu .pop { position: absolute; right: 0; top: calc(100% + 4px); min-width: 190px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: var(--s1); z-index: 30; }
.menu .pop a { display: block; padding: var(--s2) var(--s3); border-radius: 6px; color: var(--ink); text-decoration: none; }
.menu .pop a:hover, .menu .pop a[aria-current="page"] { background: var(--soft); }

/* Página */
.page { max-width: 1200px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s6); }
.narrow { max-width: 760px; margin-inline: auto; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.head .state { font-size: 16px; font-weight: 600; }
.head .sub { color: var(--mut); font-weight: 400; font-size: 14px; }

/* Botões e controles */
.btn { min-height: 36px; padding: 0 var(--s4); border-radius: var(--r); border: 1px solid var(--line); background: var(--card); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { color: var(--err); border-color: var(--err); }
.btn.sm { min-height: 28px; padding: 0 var(--s3); font-size: 12px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.input, select.input, textarea.input { min-height: 36px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r); background: var(--card); width: 100%; }
textarea.input { padding: var(--s2) var(--s3); min-height: 80px; resize: vertical; }
label.field { display: grid; gap: var(--s1); font-size: 12px; color: var(--mut); font-weight: 600; }
label.field .input { font-size: 14px; font-weight: 400; color: var(--ink); }
.err-text { color: var(--err); font-size: 12px; }

/* Seletor de opções (segmentado) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); overflow: hidden; }
.seg button { border: 0; background: transparent; min-height: 34px; padding: 0 var(--s3); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--acc-soft); color: var(--acc); font-weight: 600; }
.seg button .n { color: var(--mut); font-weight: 400; margin-left: var(--s1); }

/* Etiquetas e selos */
.chip { display: inline-flex; align-items: center; gap: var(--s1); padding: 2px var(--s2); border-radius: 999px; background: var(--soft); font-size: 12px; color: var(--mut); border: 0; }
button.chip { cursor: pointer; }
.chip.warn, .badge.warn { background: var(--warn-bg); color: var(--warn); }
.chip.err, .badge.err { background: var(--err-bg); color: var(--err); }
.chip.ok, .badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge { display: inline-flex; align-items: center; gap: var(--s1); padding: 2px var(--s2); border-radius: 999px; background: var(--soft); font-size: 12px; font-weight: 600; text-decoration: none; color: var(--ink); }

/* Avisos e progresso */
.notice { padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--warn-bg); color: var(--warn); display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin-bottom: var(--s4); }
.notice.err { background: var(--err-bg); color: var(--err); }
.notice a { color: inherit; font-weight: 600; }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; flex: 1; min-width: 120px; }
.progress i { display: block; height: 100%; background: var(--acc); width: 0; transition: width .3s; }
@media (prefers-reduced-motion: reduce) { .progress i { transition: none; } }
.runbox { display: flex; align-items: center; gap: var(--s3); flex: 1; min-width: 220px; justify-content: flex-end; }

/* Painéis */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); }
.popover { position: absolute; z-index: 15; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: var(--s4); display: grid; gap: var(--s3); min-width: min(340px, 92vw); }
.drawer { position: fixed; inset: 0 0 0 auto; width: min(460px, 100vw); background: var(--card); border-left: 1px solid var(--line); box-shadow: var(--shadow); z-index: 40; display: flex; flex-direction: column; }
.drawer .dh { padding: var(--s4); border-bottom: 1px solid var(--line); display: flex; gap: var(--s3); justify-content: space-between; align-items: start; }
.drawer .db { padding: var(--s4); overflow: auto; display: grid; gap: var(--s3); align-content: start; flex: 1; }
.drawer .df { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); display: flex; gap: var(--s2); justify-content: space-between; }
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); padding: var(--s5); box-shadow: var(--shadow); max-width: min(480px, 94vw); width: 100%; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
dialog h2 { margin-bottom: var(--s3); }
dialog .actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s4); flex-wrap: wrap; }
.toast-area { position: fixed; left: 50%; transform: translateX(-50%); bottom: var(--s5); display: grid; gap: var(--s2); z-index: 60; width: min(440px, 94vw); }
.toast { background: var(--ink); color: var(--bg); padding: var(--s3) var(--s4); border-radius: var(--r); display: flex; gap: var(--s3); justify-content: space-between; align-items: center; box-shadow: var(--shadow); }
.toast.err { background: var(--err); color: #fff; }
.toast button { background: transparent; border: 0; color: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 28px; }

/* Lista de vagas */
.list { max-width: 760px; margin-inline: auto; }
.gh { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--mut); margin: var(--s5) 0 var(--s2); }
.job { position: relative; background: var(--card); border-bottom: 1px solid var(--line); padding: var(--s3) var(--s4) var(--s3) var(--s4); display: grid; grid-template-columns: 1fr auto; gap: var(--s1) var(--s3); cursor: pointer; }
.job:first-of-type { border-top-left-radius: var(--r); border-top-right-radius: var(--r); }
.job.new::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--acc); }
.job .title { font-size: 16px; font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.job .title:hover { text-decoration: underline; }
.job .info { grid-column: 1; color: var(--mut); }
.job .info .sep { margin: 0 var(--s1); opacity: .6; }
.job .act { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: var(--s1); align-items: start; }
.job.closed { opacity: .6; }
.job.selected { outline: 2px solid var(--acc); outline-offset: -2px; }
.job .more { grid-column: 1 / -1; display: grid; gap: var(--s2); margin-top: var(--s2); padding-top: var(--s2); border-top: 1px dashed var(--line); }
.job .more .tags { display: flex; gap: var(--s1); flex-wrap: wrap; }
.job .more dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: var(--s1) var(--s3); }
.job .more dt { color: var(--mut); }
.job .more dd { margin: 0; overflow-wrap: anywhere; }
.job .locais { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s1); }
.menu-mini { position: relative; }
.empty { text-align: center; padding: var(--s6) var(--s4); color: var(--mut); background: var(--card); border-radius: var(--r); }
.empty .btn { margin-top: var(--s3); }
.filters-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s3); position: relative; }
.filters-row .grow { flex: 1 1 220px; min-width: 180px; }
.active-filters { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); min-height: 0; }
.tabs { display: flex; gap: var(--s1); margin-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.tabs button { background: transparent; border: 0; padding: var(--s2) var(--s4); cursor: pointer; border-bottom: 2px solid transparent; min-height: 40px; color: var(--mut); }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--acc); }
.tabs .n { margin-left: var(--s1); font-size: 12px; color: var(--acc); font-weight: 600; }
.footer-actions { display: flex; gap: var(--s3); justify-content: center; align-items: center; margin: var(--s5) 0; flex-wrap: wrap; }

/* Quadro de candidaturas */
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: var(--s3); align-items: start; }
.col { background: var(--soft); border-radius: var(--r); padding: var(--s2); min-height: 120px; }
.col.over { outline: 2px dashed var(--acc); }
.col h3 { font-size: 14px; padding: var(--s2); display: flex; justify-content: space-between; }
.kcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); margin-bottom: var(--s2); display: grid; gap: var(--s1); cursor: pointer; }
.kcard:hover { border-color: var(--acc); }
.kcard .t { font-weight: 600; overflow-wrap: anywhere; }
.kcard.dragging { opacity: .4; }
.kcard .row { display: flex; gap: var(--s2); justify-content: space-between; align-items: center; }
.next-actions { margin-bottom: var(--s5); }
.next-actions ul { list-style: none; padding: 0; margin: var(--s2) 0 0; display: grid; gap: var(--s1); }
.strip { margin-top: var(--s4); }
.strip summary { cursor: pointer; padding: var(--s3); background: var(--soft); border-radius: var(--r); font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: var(--s2); }
.coltabs { display: none; }

/* Tabelas */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--mut); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--soft); }
.tablewrap { overflow: auto; }

@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
  .coltabs { display: flex; gap: var(--s1); margin-bottom: var(--s3); overflow-x: auto; }
  .coltabs button { flex: 0 0 auto; min-height: 44px; }
  .col.hidden-mobile { display: none; }
}
@media (max-width: 640px) {
  .menu > button .lbl { display: none; }
  .page { padding: var(--s4) var(--s3) var(--s5); }
  .topbar .in { gap: var(--s2); padding: 0 var(--s2); }
  .topbar nav a { padding: var(--s2); }
  .btn, .seg button, .tabs button { min-height: 44px; }
  .job { grid-template-columns: 1fr; }
  .job .act { grid-column: 1; grid-row: auto; }
  .head .runbox { justify-content: stretch; }
}
