/* GRH Recruit AI — identidade visual.
   As cores da marca estão nas variáveis abaixo: ajuste-as ao manual da marca GRH Brasil
   e substitua /static/brand/logo.svg pelo logotipo oficial. */
:root {
  --brand: #0f3d6e;
  --brand-dark: #0a2b4f;
  --brand-light: #e8f0f9;
  --accent: #e5791f;
  --accent-dark: #c3620f;
  --text: #1d2733;
  --muted: #5d6b7a;
  --border: #d8e0e8;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ok: #1f7a4d;
  --ok-bg: #e6f4ec;
  --error: #b42318;
  --error-bg: #fdecea;
  --info: #1d5c96;
  --info-bg: #e8f1fb;
  --warn: #8a5a00;
  --warn-bg: #fff4dc;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: .2rem 0 1rem; color: var(--brand-dark); }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; color: var(--brand-dark); }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 24px; padding-bottom: 48px; flex: 1; }

/* topo */
.topbar { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-logo { height: 36px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.05rem; letter-spacing: .3px; }
.brand-text span { font-size: .78rem; opacity: .85; }
.mainnav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.mainnav a { color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: .92rem; opacity: .92; }
.mainnav a:hover { background: rgba(255,255,255,.12); opacity: 1; }
.userbox { display: flex; align-items: center; gap: 12px; }
.userbox-name { display: flex; flex-direction: column; font-size: .9rem; text-align: right; }
.userbox-name small { opacity: .8; font-size: .75rem; }
.userbox form { margin: 0; }

/* rodapé */
.footer { background: var(--surface); border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }

/* cartões e layout */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head p { margin: 0 0 12px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.narrow { max-width: 480px; margin: 24px auto; }
.stack > * + * { margin-top: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }

/* formulários */
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-weight: 600; color: var(--brand-dark); font-size: 1.05rem; margin-bottom: 12px; padding: 0; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 600; font-size: .88rem; }
.field .hint { color: var(--muted); font-size: .8rem; }
.req::after { content: " *"; color: var(--error); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-light); border-color: var(--brand); }
input[readonly] { background: var(--bg); color: var(--muted); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--error); }
.error-text { color: var(--error); font-size: .82rem; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400 !important; }
.check input { margin-top: 4px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.input-action { display: flex; gap: 8px; }
.input-action input { flex: 1; }
.code-input { font-size: 1.6rem !important; letter-spacing: .5rem; text-align: center; font-variant-numeric: tabular-nums; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--brand); color: #fff; }
.btn:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-outline { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-light); }
.btn-danger { background: #fff; color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: var(--error-bg); }
.btn-ghost { background: transparent; color: inherit; border-color: rgba(255,255,255,.5); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-lg { padding: 13px 22px; font-size: 1.05rem; }
.btn-ai { background: linear-gradient(135deg, var(--brand) 0%, #2a6fb5 100%); font-size: 1.05rem; padding: 13px 20px; letter-spacing: .3px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* alertas e selos */
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: #b9e2cb; }
.alert-error { background: var(--error-bg); color: var(--error); border-color: #f5c2bd; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #c4dbf2; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #f1d9a3; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--brand-light); color: var(--brand); white-space: nowrap; }
.badge-solicitada, .badge-em_analise_comercial { background: #fff4dc; color: #8a5a00; }
.badge-devolvida_cliente { background: #fdecea; color: #b42318; }
.badge-liberada_rs, .badge-atribuida { background: #e8f1fb; color: #1d5c96; }
.badge-ia_autorizada, .badge-em_selecao { background: #ede7fb; color: #5b34b5; }
.badge-concluida { background: #e6f4ec; color: #1f7a4d; }
.badge-cancelada, .badge-suspensa { background: #eef0f3; color: #5d6b7a; }

/* tabelas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: #fafbfc; }
tr:hover td { background: #fafcff; }
.empty { text-align: center; padding: 32px; color: var(--muted); }

/* dados */
dl.data { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; margin: 0; }
dl.data dt { color: var(--muted); font-size: .88rem; }
dl.data dd { margin: 0; white-space: pre-wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text); }
.stat strong { display: block; font-size: 1.6rem; color: var(--brand-dark); }
.stat span { font-size: .85rem; color: var(--muted); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 2px solid var(--border); padding: 0 0 14px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline time { color: var(--muted); font-size: .8rem; display: block; }
.steps { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.steps span { padding: 6px 12px; border-radius: 999px; background: #eef0f3; color: var(--muted); font-size: .85rem; }
.steps span.on { background: var(--brand); color: #fff; }
.hero { background: linear-gradient(135deg, var(--brand) 0%, #1f5a96 100%); color: #fff; border-radius: 14px; padding: 40px 32px; margin-bottom: 24px; }
.hero h1 { color: #fff; font-size: 2rem; }
.hero p { max-width: 640px; opacity: .92; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.2rem; background: #fff; padding: 6px 10px; border-radius: 6px; border: 1px dashed var(--accent); }
details summary { cursor: pointer; font-weight: 600; color: var(--brand); }

@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4, .split { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3 { grid-column: auto; }
  dl.data { grid-template-columns: 1fr; }
  dl.data dt { margin-top: 6px; }
  .userbox-name { display: none; }
  .topbar-inner { justify-content: space-between; gap: 10px; }
  .mainnav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -8px; }
  .mainnav a { white-space: nowrap; }
  .hero { padding: 28px 20px; }
}
.label-strong { font-weight: 600; font-size: .88rem; }
.mt { margin-top: 14px; }
.mb0 { margin-bottom: 0; }
.right { text-align: right; }
.inline-form { display: inline; margin: 0; }
fieldset.card > legend { float: left; width: 100%; margin-bottom: 14px; }
fieldset.card > legend + * { clear: both; }
.req-temp { color: var(--error); font-weight: 400; font-size: .8rem; }
[hidden] { display: none !important; }
.badge-invite-pendente { background: #fff4dc; color: #8a5a00; }
.badge-invite-utilizado { background: #e6f4ec; color: #1f7a4d; }
.badge-invite-expirado, .badge-invite-revogado { background: #eef0f3; color: #5d6b7a; }
.badge-it-atende { background: #e6f4ec; color: #1f7a4d; }
.badge-it-parcial { background: #fff4dc; color: #8a5a00; }
.badge-it-nao_atende { background: #fdecea; color: #b42318; }
.badge-it-sem_evidencia { background: #eef0f3; color: #5d6b7a; }
.badge-dec-pre_selecionado, .badge-dec-contratado { background: #e6f4ec; color: #1f7a4d; }
.badge-dec-em_contato { background: #e8f1fb; color: #1d5c96; }
.badge-dec-nao_seguir { background: #eef0f3; color: #5d6b7a; }
section.card { scroll-margin-top: 16px; }
dl.data dd { overflow-wrap: anywhere; }

/* Entrega 3: orçamento de IA, resultados parciais, parâmetros */
.warn-text { color: var(--warn); font-weight: 600; }
.search-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.search-form label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
input[type=number].input-xs { width: 5.5em; padding: 4px 6px; }
.badge-partial { background: var(--warn-bg); color: var(--warn); border: 1px solid #f1d9a3; }
.budget-meter { width: 100%; height: 14px; margin: 8px 0 4px; }
.params-form .row { display: grid; grid-template-columns: minmax(0, 1fr) 17em; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border, #e3e8ef); }
@media (max-width: 640px) { .params-form .row { grid-template-columns: 1fr; } }
.ready-ok { color: var(--ok); font-weight: 600; }
.ready-pend { color: var(--warn); font-weight: 600; }
.ready-fail { color: var(--error); font-weight: 600; }
