/* Jost: alternativa livre (SIL OFL) à Futura PT do manual da marca */
@font-face { font-family: 'Jost'; font-weight: 400; font-display: swap; src: url(fonts/jost-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Jost'; font-weight: 400; font-display: swap; src: url(fonts/jost-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF; }
@font-face { font-family: 'Jost'; font-weight: 500; font-display: swap; src: url(fonts/jost-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Jost'; font-weight: 500; font-display: swap; src: url(fonts/jost-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF; }
@font-face { font-family: 'Jost'; font-weight: 600; font-display: swap; src: url(fonts/jost-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Jost'; font-weight: 600; font-display: swap; src: url(fonts/jost-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF; }
@font-face { font-family: 'Jost'; font-weight: 700; font-display: swap; src: url(fonts/jost-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Jost'; font-weight: 700; font-display: swap; src: url(fonts/jost-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF; }
:root {
  /* cores do Manual das Normas Gráficas: Azul 282 C #041E42, Vermelho 1787 C #F4364C */
  --azul: #041e42;
  --azul-2: #13325e;
  --vermelho: #f4364c;
  --petrol: var(--azul);
  --petrol-2: var(--azul-2);
  --ink: #0f1d33;
  --muted: #586579;
  --line: #d7dce4;
  --bg: #eef0f3;
  --paper: #ffffff;
  --amber: #e8a317;
  --amber-bg: #fdf3dc;
  --red: #d42a40;
  --red-bg: #fde8eb;
  --green: #2f7d4f;
  --green-bg: #e3f2e8;
  --blue: #13325e;
  --blue-bg: #e3e9f3;
  --grey-bg: #eceff0;
  --radius: 6px;
  font-family: 'Jost', 'Futura PT', Futura, system-ui, sans-serif;
  font-size: 15px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
a { color: var(--petrol-2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--vermelho); outline-offset: 2px; }
.boot { padding: 40px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- moldura */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--petrol); color: #e6ebf2; padding: 22px 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 0 22px 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
.brand img, .brand .mono { grid-row: span 2; width: 26px; height: auto; }
.mono { display: inline-flex; align-items: center; justify-content: center; background: var(--vermelho); color: #fff; font-weight: 700; border-radius: 6px; aspect-ratio: 1; font-size: 16px; }
.brand-preview img, .brand-preview .mono { width: 32px; height: auto; display: block; }
.topbar img, .topbar .mono { width: 18px; height: auto; }
.brand b { display: block; font-size: 21px; font-weight: 700; letter-spacing: .04em; color: #fff; line-height: 1.1; }
.brand span { font-size: 12.5px; color: #a9b7cc; }
.nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav h4 { margin: 16px 12px 6px; font-size: 12px; font-weight: 500; color: #8d9bb3; }
.nav a { color: #e6ebf2; text-decoration: none; padding: 8px 12px; border-radius: var(--radius); display: flex; justify-content: space-between; align-items: center; }
.nav a:hover { background: rgba(255,255,255,.07); }
.nav a.on { background: rgba(255,255,255,.1); color: #fff; font-weight: 500; box-shadow: inset 3px 0 0 var(--vermelho); }
.nav .count { background: var(--vermelho); color: #fff; font-size: 12px; font-weight: 600; border-radius: 10px; padding: 0 7px; }
.side .who { margin-top: auto; padding: 16px 22px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; color: #a9b7cc; }
.side .who b { color: #fff; display: block; font-weight: 500; }
.side .who button { background: none; border: 0; color: #cfd8e6; padding: 6px 0 0; cursor: pointer; text-decoration: underline; }
.topbar { display: none; }
main { padding: 28px 36px 60px; max-width: 1160px; width: 100%; }
h1 { font-size: 28px; font-weight: 600; margin: 0 0 14px; color: var(--azul); line-height: 1.15; }
h1::after { content: ''; display: block; width: 26px; height: 3px; background: var(--vermelho); margin-top: 10px; }
.login h1::after { margin-top: 8px; }
h2 { font-size: 19px; font-weight: 600; margin: 30px 0 10px; color: var(--azul); }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; color: var(--azul); }
.sub { color: var(--muted); margin: 0 0 22px; max-width: 70ch; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

/* ---------- botões e campos */
.btn { border: 1px solid var(--petrol); background: var(--petrol); color: #fff; padding: 8px 14px; border-radius: var(--radius); cursor: pointer; font-weight: 500; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--petrol-2); }
.btn.ghost { background: transparent; color: var(--petrol); }
.btn.ghost:hover { background: var(--grey-bg); }
.btn.small { padding: 4px 10px; font-size: 13.5px; }
.btn.danger { border-color: var(--red); background: transparent; color: var(--red); }
.btn[disabled] { opacity: .5; cursor: default; }
label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
textarea { min-height: 70px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14.5px; margin: 6px 0; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form .full { grid-column: 1 / -1; }
.form fieldset { grid-column: 1 / -1; border: 0; border-top: 1px solid var(--line); padding: 14px 0 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form legend { font-weight: 600; padding: 0 8px 0 0; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.err { color: var(--red); font-size: 14px; margin: 8px 0; }

/* ---------- blocos */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { font-size: 28px; font-weight: 600; display: block; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13.5px; }
.empty { color: var(--muted); padding: 14px 0; }
dl.facts { display: grid; grid-template-columns: 180px 1fr; gap: 6px 14px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* ---------- tabelas */
table.list { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); background: #f6f7fa; }
table.list td { padding: 10px 12px; border-bottom: 1px solid #e7eaf0; vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #f4f6fa; }

/* ---------- estado: a faixa lateral marca o documento como uma etiqueta de segurança */
.tag { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.t-valido, .t-cumprido { background: var(--green-bg); color: var(--green); }
.t-a_caducar, .t-caduca_antes, .t-em_curso { background: var(--amber-bg); color: #8a5d00; }
.t-caducado, .t-rejeitado, .t-atrasado, .t-em_falta { background: var(--red-bg); color: var(--red); }
.t-por_validar { background: var(--blue-bg); color: var(--blue); }
.t-neutral { background: var(--grey-bg); color: var(--muted); }
.doc { display: grid; grid-template-columns: 6px 1fr auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.doc .bar { background: var(--green); }
.doc.s-a_caducar .bar, .doc.s-em_curso .bar { background: repeating-linear-gradient(-45deg, var(--amber) 0 6px, var(--azul) 6px 12px); }
.doc.s-caducado .bar, .doc.s-rejeitado .bar { background: var(--red); }
.doc.s-por_validar .bar { background: var(--blue); }
.doc .body { padding: 12px 14px; min-width: 0; }
.doc .body .meta { color: var(--muted); font-size: 13.5px; }
.doc .side-info { padding: 12px 14px; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.doc .days { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.doc .days small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.alert-list { list-style: none; padding: 0; margin: 0; }
.alert-list li { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid #e7eaf0; }
.alert-list li:last-child { border-bottom: 0; }
.alert-list .when { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.warn { background: var(--amber-bg); border: 1px solid #f0d28a; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }

/* ---------- organograma */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 22px; border-left: 1px solid var(--line); padding-left: 16px; }
.tree li { margin: 8px 0; }
.node { display: inline-block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; text-decoration: none; color: var(--ink); }
.node:hover { border-color: var(--petrol-2); }
.node .t { color: var(--muted); font-size: 13px; }
.node .d { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--petrol-2); background: #e3e9f3; padding: 1px 6px; border-radius: 3px; }

/* ---------- diálogo e aviso */
dialog { border: 0; border-radius: 8px; padding: 0; width: min(680px, 94vw); box-shadow: 0 18px 50px rgba(4,30,66,.25); }
dialog::backdrop { background: rgba(4,20,45,.5); }
dialog .dh { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
dialog .dh h3 { margin: 0; font-size: 17px; }
dialog .db { padding: 18px 22px; max-height: 70vh; overflow-y: auto; }
dialog .df { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.x { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--radius); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
#toast.on { opacity: 1; }

/* ---------- entrada */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .left { background: var(--azul); color: #e6ebf2; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .left > * { position: relative; }
.login .left .bigj { position: absolute; right: -30px; bottom: -50px; width: 42%; max-width: 280px; }
.login .left .bigj img { width: 100%; height: auto; display: block; }
.login .left .logo { display: flex; align-items: center; gap: 14px; }
.login .left .logo img, .login .left .logo .mono { width: 34px; height: auto; flex: none; }
.login .left .logo .mono { font-size: 20px; }
.login .left b { font-size: 34px; font-weight: 700; letter-spacing: .04em; color: #fff; line-height: 1; }
.login .left .logo small { display: block; font-size: 12.5px; color: #cfd8e6; letter-spacing: 0; margin-top: 4px; }
.login .left p { font-size: 22px; line-height: 1.35; max-width: 22ch; color: #fff; }
.login .left small { color: #8d9bb3; }
.login .right { display: flex; align-items: center; justify-content: center; padding: 30px; }
.login form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 30% 0 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; height: 100vh; }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 12px; background: var(--petrol); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 20; }
  .topbar button { background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: var(--radius); padding: 4px 10px; }
  main { padding: 18px 16px 50px; }
  .grid2, .grid3, .form, .form fieldset { grid-template-columns: 1fr; }
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dd { margin-bottom: 8px; }
  .login { grid-template-columns: 1fr; }
  .login .left { padding: 28px; min-height: auto; }
  .login .left p { font-size: 17px; }
  table.list .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- férias e ausências */
[hidden] { display: none !important; }
.grid2 + .grid2 { margin-top: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 6px 0 8px; }
.t-pendente { background: var(--blue-bg); color: var(--blue); }
.t-aprovado { background: var(--green-bg); color: var(--green); }
.t-recusado { background: var(--red-bg); color: var(--red); }
.t-cancelado { background: var(--grey-bg); color: var(--muted); }
.bal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bal div { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.bal b { display: block; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.bal span { font-size: 12.5px; color: var(--muted); }
.bal .main { background: var(--azul); border-color: var(--azul); }
.bal .main b, .bal .main span { color: #fff; }
.pv { padding: 12px 14px; background: var(--blue-bg); border-color: transparent; }
.cal-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.cal { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.cal th, .cal td { border: 1px solid var(--line); text-align: center; min-width: 24px; height: 30px; padding: 0; }
.cal tr > th:first-child { text-align: left; padding: 0 10px; white-space: nowrap; min-width: 170px; font-weight: 500; position: sticky; left: 0; background: var(--paper); }
.cal td { color: #fff; font-weight: 600; }
.cal .off { background: var(--grey-bg); }
.k-ferias { background: var(--azul) !important; }
.k-pessoal { background: var(--vermelho) !important; }
.k-servico { background: #6f86a8 !important; }
.k-meio_dia { background: linear-gradient(90deg, var(--azul) 0 50%, #fff 50%) !important; }
.cal td.pend, .legend .pend { background: repeating-linear-gradient(-45deg, var(--azul) 0 4px, #fff 4px 7px) !important; color: var(--azul); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.legend span { display: inline-block; width: 14px; height: 14px; border-radius: 2px; margin-right: -8px; vertical-align: middle; border: 1px solid var(--line); }
@media (max-width: 720px) { .bal { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  main { min-width: 0; }
  table.list { display: block; overflow-x: auto; max-width: 100%; }
  .spread > .btn { margin-bottom: 12px; }
}
.cal small.code { color: var(--muted); font-weight: 500; font-size: 11px; }
.cal small.sch { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.k-justificada { background: #6b8f71 !important; }
.k-injustificada { background: repeating-linear-gradient(45deg, var(--vermelho) 0 4px, #fff 4px 7px) !important; }

.nav .soon { display: block; padding: 8px 22px; font-size: 12.5px; color: rgba(255,255,255,.45); }

/* ---------- HES */
table.bars { width: 100%; border-collapse: collapse; font-size: 13px; }
table.bars td { padding: 4px 6px; }
table.bars td:first-child { width: 42px; color: var(--muted); text-transform: capitalize; }
table.bars td:last-child { width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.bar-track { display: flex; height: 14px; background: var(--grey-bg); border-radius: 2px; overflow: hidden; }
.bar-track span { display: block; height: 100%; }
.b-nm { background: var(--azul-2) !important; }
.b-ot { background: #8aa0bf !important; }
.b-rc { background: var(--vermelho) !important; }

/* ---------- formação */
.mxt td { font-weight: 600; font-size: 13px; }
.mx-cumprido { background: var(--green-bg) !important; color: var(--green) !important; }
.mx-a_caducar { background: var(--amber-bg) !important; color: #8a5d00 !important; }
.mx-caducado, .mx-em_falta { background: var(--red-bg) !important; color: var(--red) !important; }
.mx-inscrito { background: var(--blue-bg) !important; color: var(--blue) !important; }
.mxt td.na { background: repeating-linear-gradient(45deg, transparent 0 4px, var(--grey-bg) 4px 6px); }
.legend .mx { width: 20px; height: 20px; text-align: center; font-weight: 700; font-size: 12px; line-height: 18px; margin-right: -2px; }
.mxt .vt { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; padding: 6px 0; font-size: 12px; max-height: 160px; overflow: hidden; }

/* ---------- avaliação */
.phases { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; }
.phases span { flex: 1 1 120px; padding: 8px 10px; font-size: 12.5px; background: var(--grey-bg); color: var(--muted); border-radius: 2px; position: relative; }
.phases span.done { background: var(--blue-bg); color: var(--blue); }
.phases span.on { background: var(--azul); color: #fff; font-weight: 600; }
.phases span.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--vermelho); }
.panel.apr { margin-bottom: 14px; }
.panel.apr h3 { display: flex; align-items: center; gap: 10px; }
.num-badge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--azul); color: #fff; font-size: 12.5px; font-weight: 600; }
.objrow { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.objrow input[name=text] { flex: 2 1 220px; } .objrow input[name=measure] { flex: 1 1 160px; }
.fb { border-left: 3px solid var(--azul-2); padding: 6px 12px; margin: 8px 0; background: var(--blue-bg); }
.fb p { margin: 4px 0 0; font-size: 14px; }
.pdp input { flex: 1 1 180px; }

/* ---------- acolhimento */
pre.tpl { white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.55; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; max-height: 420px; overflow: auto; color: var(--ink); margin: 8px 0 0; }
details.panel summary { cursor: pointer; font-weight: 600; }
.video { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
textarea { font-family: inherit; }
