:root {
  --ink: #111111;
  --ink-2: #1c1c1c;
  --ink-3: #2a2a2a;
  --text: #16181d;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f7f9;
  --card: #ffffff;
  --accent: #f5a81c;      /* amarelo do logo Inclua */
  --accent-ink: #1a1200;
  --ok: #15803d;
  --ok-bg: #e8f6ee;
  --warn: #b45309;
  --warn-bg: #fff4e0;
  --bad: #b91c1c;
  --bad-bg: #fdecec;
  --info: #1d4ed8;
  --info-bg: #e8effd;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, 'Segoe UI', Arial, sans-serif; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); }

/* ---------- layout */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 96px; flex: 0 0 96px; background: var(--ink); color: #fff; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { padding: 18px 6px 14px; text-align: center; border-bottom: 1px solid #222; }
.brand .w1 { font-weight: 800; font-size: 19px; letter-spacing: -.5px; line-height: 1; }
.brand .w2 { font-size: 8.5px; letter-spacing: 4px; color: var(--accent); margin-top: 3px; font-weight: 600; padding-left: 4px; }
.nav { flex: 1; overflow-y: auto; padding: 8px 6px; display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: 8px;
  text-decoration: none; color: #cfcfcf; font-size: 11.5px; text-align: center;
}
.nav a svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.on { background: var(--ink-3); color: #fff; }
.nav a.on svg { stroke: var(--accent); }
.side-foot { padding: 10px 6px 14px; border-top: 1px solid #222; text-align: center; font-size: 11px; color: #9a9a9a; }
.side-foot .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px; }
.side-foot button { background: none; border: 0; color: #cfcfcf; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 auto; font-size: 11.5px; }
.side-foot button:hover { color: #fff; }
.side-foot svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.main { flex: 1; min-width: 0; padding: 26px 34px 60px; }
.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.3px; }
.head .grow { flex: 1; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* ---------- componentes */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .3px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #c9ccd2; }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.dark:hover { background: #000; }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.accent:hover { filter: brightness(.96); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 11.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 18px 20px; }
.card h2 { font-size: 15px; margin: 0 0 12px; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.kpi { padding: 16px 18px; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.kpi .v.sm { font-size: 17px; letter-spacing: -.2px; line-height: 1.3; padding: 4px 0 3px; overflow-wrap: anywhere; }
.kpi .l { color: var(--muted); font-size: 12.5px; }
.kpi.alert .v { color: var(--warn); }

table.t { width: 100%; border-collapse: collapse; }
.t th, .t td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; background: #fafafa; }
.t tr:last-child td { border-bottom: 0; }
.t tr.link { cursor: pointer; }
.t tr.link:hover td { background: #fafafa; }
.t td.num { text-align: right; font-variant-numeric: tabular-nums; }
.t .sub { color: var(--muted); font-size: 12px; }
.tablewrap { overflow-x: auto; }

.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.mute { background: #f0f1f3; color: #555; }

.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.tabs button { border: 0; background: none; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 13px; }
.tabs button.on { background: var(--ink); color: #fff; }

.search { height: 38px; border: 1px solid var(--line); border-radius: 6px; padding: 0 12px; min-width: 260px; background: #fff; }
.muted { color: var(--muted); }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.bar { height: 6px; background: #eceef1; border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--ok); }

/* ---------- formulários */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: #374151; }
.field input, .field select, .field textarea {
  width: 100%; height: 40px; border: 1px solid #d6d9de; border-radius: 6px; padding: 0 11px; background: #fff;
}
.field textarea { height: 80px; padding: 9px 11px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.err { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login .art { background: var(--ink); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; }
.login .art .logo .w1 { font-size: 54px; font-weight: 800; letter-spacing: -2px; line-height: 1; }
.login .art .logo .w2 { font-size: 15px; letter-spacing: 12px; color: var(--accent); font-weight: 600; margin-top: 6px; padding-left: 6px; }
.login .art p { color: #bdbdbd; max-width: 380px; font-size: 15px; }
.login .art .tag { font-size: 12px; color: #8a8a8a; }
.login .box { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.login form { width: 100%; max-width: 360px; }
.login h1 { font-size: 24px; margin: 0 0 4px; }
.login .lead { color: var(--muted); margin: 0 0 22px; }
.login .field { margin-bottom: 14px; }
.login .btn { width: 100%; height: 44px; }

/* ---------- documentos */
.docs { display: grid; gap: 10px; }
.doc { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fff; }
.doc .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc .top .name { font-weight: 600; flex: 1; min-width: 200px; }
.doc .files { margin-top: 8px; display: grid; gap: 6px; }
.doc .file { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; padding: 6px 8px; background: #fafafa; border-radius: 6px; }
.doc .file .fn { flex: 1; min-width: 160px; word-break: break-all; }
.doc .file a { text-decoration: underline; cursor: pointer; }
.doc .reason { font-size: 12.5px; color: var(--bad); }
.upl { position: relative; overflow: hidden; }
.upl input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- materiais */
.mat-group { margin-bottom: 22px; }
.mat-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 8px; }
.mat { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mat:last-child { border-bottom: 0; }
.mat .ic { width: 34px; height: 34px; border-radius: 8px; background: #f3f4f6; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #555; flex: 0 0 34px; }
.mat .tt { flex: 1; min-width: 200px; }
.mat .tt b { display: block; font-weight: 600; }
.mat .tt span { font-size: 12px; color: var(--muted); }
.viewer { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* ---------- modal e aviso */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 620px; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 980px; }
.modal h2 { margin: 0 0 14px; font-size: 18px; }
.secret { font-family: Consolas, monospace; font-size: 18px; background: #fafafa; border: 1px dashed #c9ccd2; padding: 10px 14px; border-radius: 6px; letter-spacing: 1px; user-select: all; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 8px; font-weight: 500; transition: transform .2s; z-index: 60; max-width: 90vw; }
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--bad); }

.notice { border-left: 4px solid var(--accent); background: #fffaf0; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.progress { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- celular */
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login .art { padding: 28px 24px; }
  .login .art p, .login .art .tag { display: none; }
  .login .art .logo .w1 { font-size: 40px; }
}
@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; flex: none; position: sticky; top: 0; z-index: 20; flex-direction: row; align-items: center; }
  .brand { border: 0; padding: 10px 12px; }
  .brand .w1 { font-size: 16px; }
  .nav { flex-direction: row; overflow-x: auto; padding: 6px; }
  .nav a { min-width: 70px; padding: 6px 4px; font-size: 10.5px; }
  .side-foot { border: 0; padding: 6px 10px; }
  .side-foot .who { display: none; }
  .main { padding: 18px 16px 50px; }
  .form { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .v { font-size: 22px; }
  .kpi .v.sm { font-size: 14px; }
  .search { min-width: 0; width: 100%; }
  .t th, .t td { padding: 9px 10px; }
  .hide-sm { display: none; }
}
