/* ============================================================
   SOJI · Componentes
   ============================================================ */

/* ---------- APP SHELL ---------- */
#app { display: none; grid-template-rows: var(--header-h) 1fr; height: 100vh; overflow: hidden; }
#app.vis { display: grid; }

/* ---- Header (escuro) ---- */
.hdr {
  background: var(--navy);
  border-bottom: 1px solid var(--navy-border);
  box-shadow: inset 0 -3px 0 var(--gold);
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s5); z-index: 50;
}
.hdr .brand { display: flex; align-items: center; gap: var(--s3); }
.hdr .brand svg { width: 34px; height: 34px; flex-shrink: 0; }
.hdr .brand .name { font-family: var(--f-display); font-weight: 700; font-size: 1.02rem; color: var(--gold); letter-spacing: .06em; line-height: 1; }
.hdr .brand .tag  { font-size: .58rem; color: var(--on-navy-mut); letter-spacing: .2em; text-transform: uppercase; margin-top: 3px; }
.hdr .spacer { margin-left: auto; }
.hdr .hacts { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }

.plan-badge { font-family: var(--f-mono); font-size: .62rem; padding: 4px 9px; border-radius: 4px; border: 1px solid; white-space: nowrap; letter-spacing: .08em; }
.plan-bronze { color: #e0a86a; border-color: rgba(176,109,46,.5); background: rgba(176,109,46,.15); }
.plan-prata  { color: #cbd5e1; border-color: rgba(148,163,184,.4); background: rgba(148,163,184,.14); }
.plan-ouro   { color: var(--gold-light); border-color: rgba(201,162,39,.5); background: rgba(201,162,39,.14); }
.plan-admin  { color: var(--teal); border-color: rgba(43,188,180,.5); background: rgba(43,188,180,.14); }

.quota { display: flex; align-items: center; gap: var(--s2); padding: 4px 10px; border-radius: 6px; border: 1px solid var(--navy-border); background: rgba(255,255,255,.04); }
.quota-lbl { font-family: var(--f-mono); font-size: .62rem; color: var(--on-navy-mut); white-space: nowrap; }
.quota-track { width: 78px; height: 6px; background: rgba(255,255,255,.12); border-radius: 3px; overflow: hidden; }
.quota-fill { height: 100%; border-radius: 3px; transition: width .3s ease; }
.quota-pct { font-family: var(--f-mono); font-size: .62rem; color: var(--on-navy-mut); white-space: nowrap; }

.hbtn { background: rgba(255,255,255,.06); border: 1px solid var(--navy-border); color: var(--on-navy-mut); font-size: .74rem; padding: 6px 11px; border-radius: 6px; white-space: nowrap; transition: all .15s; }
.hbtn:hover { border-color: rgba(201,162,39,.45); color: var(--gold-light); }

/* ---- Body: sidebar + workspace ---- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; overflow: hidden; }

.sidebar {
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: var(--s4) var(--s3);
  overflow-y: auto;
}
.nav-lbl { font-family: var(--f-mono); font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding: 0 var(--s2); margin: var(--s4) 0 var(--s2); }
.nav-lbl:first-child { margin-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent;
  color: var(--ink-soft); padding: 9px var(--s3); border-radius: 8px;
  font-size: var(--t-sm); font-weight: 500; margin-bottom: 2px; transition: all .15s;
}
.nav-item .ico { width: 18px; text-align: center; font-size: .95rem; opacity: .9; }
.nav-item:hover { background: #eef2f7; color: var(--ink); }
.nav-item.active { background: rgba(201,162,39,.12); border-color: rgba(201,162,39,.35); color: var(--gold-ink); font-weight: 600; }
.nav-item.locked { opacity: .45; cursor: not-allowed; }
.nav-item.locked:hover { background: transparent; color: var(--ink-soft); }

.sidebar .foot { margin-top: auto; padding: var(--s4) var(--s2) 0; border-top: 1px solid var(--line-soft); }
.sidebar .foot .princ { font-size: .68rem; color: var(--muted); line-height: 1.9; }
.sidebar .foot .credit { font-size: .58rem; color: #9aa7b4; margin-top: var(--s3); }

/* ---- Workspace ---- */
.workspace { background: var(--bg); overflow-y: auto; }
#view { min-height: 100%; }

/* ---------- COMPONENTES GENÉRICOS ---------- */
.btn { display: inline-flex; align-items: center; gap: var(--s2); border: none; border-radius: 8px; padding: 10px 18px; font-size: var(--t-sm); font-weight: 600; transition: all .15s; }
.btn-primary { background: var(--teal-ink); color: #fff; }
.btn-primary:hover { background: #106b66; }
.btn-ghost { background: var(--surface); color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: #cdd6e0; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }

.page { max-width: 1080px; margin: 0 auto; padding: var(--s8) var(--s8) var(--s10); }
.page-head { margin-bottom: var(--s6); }
.page-head h1 { font-size: var(--t-xl); }
.page-head p { color: var(--muted); margin-top: var(--s2); }

/* Placeholder de módulos em construção */
.stub { max-width: 620px; margin: 8vh auto 0; text-align: center; padding: var(--s8); }
.stub .badge { display: inline-block; font-family: var(--f-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-ink); background: var(--ok-bg); border: 1px solid #bfe6d3; padding: 5px 12px; border-radius: 20px; margin-bottom: var(--s5); }
.stub h2 { font-size: var(--t-lg); margin-bottom: var(--s3); }
.stub p { color: var(--muted); }

/* ---------- TOAST ---------- */
#toast { position: fixed; bottom: 22px; right: 22px; z-index: 300; background: var(--navy); color: var(--on-navy); padding: 11px 18px; border-radius: 8px; font-size: var(--t-sm); box-shadow: var(--shadow-lg); transform: translateY(70px); opacity: 0; transition: all .28s; pointer-events: none; border-left: 3px solid var(--teal); }
#toast.show { transform: translateY(0); opacity: 1; }
#toast.ok { border-left-color: var(--ok); }
#toast.no { border-left-color: var(--danger); }

/* ---------- MODAIS ---------- */
.modal { display: none; position: fixed; inset: 0; background: rgba(20,32,44,.55); backdrop-filter: blur(2px); z-index: 500; align-items: center; justify-content: center; padding: var(--s4); }
.modal.show { display: flex; }
.modal-box { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: var(--s8); max-width: 440px; width: 100%; }
.modal-box h3 { font-size: var(--t-md); margin-bottom: var(--s3); }
.modal-box p { font-size: var(--t-sm); color: var(--muted); line-height: 1.7; margin-bottom: var(--s5); }
.modal-actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s5); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.field label { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--f-body); font-size: var(--t-sm); padding: 10px 12px; border-radius: 8px; outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); }

/* ---------- LOGIN ---------- */
#login { position: fixed; inset: 0; z-index: 9999; background: var(--navy-deep); display: flex; align-items: center; justify-content: center; padding: var(--s4);
  background-image: radial-gradient(1200px 600px at 50% -10%, rgba(201,162,39,.10), transparent 60%); }
#login.hide { display: none; }
.login-box { background: var(--navy); border: 1px solid rgba(201,162,39,.25); border-top: 3px solid var(--gold); border-radius: var(--r-lg); padding: var(--s10) var(--s8); width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); text-align: center; }
.login-box svg { width: 54px; height: 54px; margin-bottom: var(--s3); }
.login-box h2 { color: var(--gold); font-size: var(--t-lg); }
.login-box .sub { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin: 6px 0 var(--s6); }
.login-box .field { text-align: left; }
.login-box .field input { background: var(--navy-mid); border-color: var(--navy-border); color: var(--on-navy); }
.login-box .field input:focus { border-color: rgba(201,162,39,.6); }
.pwrap { position: relative; }
.pwrap input { padding-right: 42px; }
.peye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--on-navy-mut); font-size: .9rem; padding: 6px; }
.peye:hover { color: var(--gold); }
.login-box .btn-primary { width: 100%; margin-top: var(--s2); background: var(--teal); }
.login-box .btn-primary:hover { background: var(--teal-ink); }
.login-err { display: none; background: rgba(209,73,63,.12); border: 1px solid rgba(209,73,63,.4); color: #f0a8a2; font-size: var(--t-xs); padding: 9px 12px; border-radius: 6px; margin-top: var(--s3); }
.login-err.show { display: block; }
.login-foot { font-size: .64rem; color: #5b7089; margin-top: var(--s5); line-height: 1.7; }

/* ---------- ASSISTENTE (chat, re-tematizado p/ workspace claro) ---------- */
.assist { display: flex; flex-direction: column; height: 100%; }
.assist-modes { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: var(--s4) var(--s6); border-bottom: 1px solid var(--line); background: var(--surface); }
.assist-modes .lbl { font-family: var(--f-mono); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-right: var(--s2); }
.mbtn { background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); font-size: var(--t-xs); padding: 6px 11px; border-radius: 18px; transition: all .15s; }
.mbtn:hover { border-color: #cdd6e0; }
.mbtn.act { background: rgba(201,162,39,.12); border-color: rgba(201,162,39,.4); color: var(--gold-ink); font-weight: 600; }
.mbtn.locked { opacity: .4; cursor: not-allowed; }

.assist-tabs { display: flex; gap: 2px; padding: 0 var(--s6); background: var(--surface); border-bottom: 1px solid var(--line); }
.tbtn { padding: 10px 16px; font-size: var(--t-sm); background: transparent; border: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tbtn:hover { color: var(--ink); }
.tbtn.act { color: var(--gold-ink); border-bottom-color: var(--gold); font-weight: 600; }
.tpan { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.tpan.act { display: flex; }

.chatbox { flex: 1; overflow-y: auto; padding: var(--s6); display: flex; flex-direction: column; gap: var(--s4); }
.welc { text-align: center; max-width: 520px; margin: 6vh auto 0; color: var(--muted); }
.welc h2 { font-size: var(--t-lg); color: var(--ink); margin-bottom: 6px; }
.welc .eyebrow { display: block; margin-bottom: var(--s3); color: var(--teal-ink); }
.welc p { font-size: var(--t-sm); margin: 0 auto var(--s5); max-width: 400px; }
.qbtns { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; }
.qb { background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); padding: 7px 13px; border-radius: 8px; font-size: var(--t-xs); transition: all .15s; }
.qb:hover { border-color: rgba(201,162,39,.4); color: var(--gold-ink); }

.msg { display: flex; gap: var(--s3); max-width: 860px; }
.msg.usr { align-self: flex-end; flex-direction: row-reverse; }
.av { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .9rem; border: 1.5px solid; }
.msg.bot .av { background: rgba(201,162,39,.12); border-color: rgba(201,162,39,.5); color: var(--gold-ink); }
.msg.usr .av { background: rgba(43,188,180,.12); border-color: rgba(43,188,180,.4); color: var(--teal-ink); }
.bub { padding: 13px 16px; border-radius: 10px; line-height: 1.7; font-size: var(--t-sm); max-width: 720px; box-shadow: var(--shadow-sm); }
.msg.bot .bub { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--gold); color: var(--ink); }
.msg.usr .bub { background: #e9f7f6; border: 1px solid #c6e9e6; color: var(--ink); }
.bub h3 { font-family: var(--f-display); color: var(--gold-ink); font-size: .92rem; margin: 13px 0 5px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.bub h3:first-child { margin-top: 0; }
.bub ul { padding-left: 18px; margin: 6px 0; }
.bub li { margin-bottom: 3px; }
.bub strong { color: var(--gold-ink); }
.bub em { color: var(--muted); }
.bub table { width: 100%; border-collapse: collapse; font-size: .8rem; margin: 9px 0; }
.bub th { background: rgba(201,162,39,.1); color: var(--gold-ink); font-family: var(--f-mono); font-size: .66rem; text-transform: uppercase; padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; }
.bub td { padding: 6px 9px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); }
.bub code { font-family: var(--f-mono); font-size: .82em; background: rgba(201,162,39,.1); padding: 1px 5px; border-radius: 4px; color: var(--gold-ink); }
.bub hr { border: none; border-top: 1px solid var(--line); margin: 10px 0; }
.bact { display: flex; gap: 5px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.bbtn { font-size: .68rem; background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 4px 9px; border-radius: 6px; }
.bbtn:hover { border-color: rgba(201,162,39,.4); color: var(--gold-ink); }
.errbub { background: var(--danger-bg); border: 1px solid #f3c6c2; color: #b3372e; padding: 10px 14px; border-radius: 8px; font-size: var(--t-sm); }

.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); opacity: .4; display: inline-block; margin: 0 2px; animation: tp 1.2s infinite; }
.typing span:nth-child(2){ animation-delay: .2s; }
.typing span:nth-child(3){ animation-delay: .4s; }
@keyframes tp { 0%,80%,100%{ opacity:.4; transform:scale(1);} 40%{ opacity:1; transform:scale(1.3);} }

.inarea { border-top: 1px solid var(--line); padding: var(--s4) var(--s6); background: var(--surface); }
.inrow { display: flex; gap: var(--s2); align-items: flex-end; }
#userIn { flex: 1; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-family: var(--f-body); font-size: var(--t-sm); padding: 11px 14px; border-radius: 10px; resize: none; min-height: 46px; max-height: 140px; line-height: 1.5; outline: none; }
#userIn:focus { border-color: var(--teal); }
.iconbtn { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.05rem; border: 1px solid; }
#voiceBtn { background: rgba(201,162,39,.1); color: var(--gold-ink); border-color: rgba(201,162,39,.3); }
#voiceBtn.rec { background: rgba(209,73,63,.14); color: var(--danger); border-color: rgba(209,73,63,.5); animation: vp 1s infinite; }
@keyframes vp { 0%,100%{ transform: scale(1);} 50%{ transform: scale(1.08);} }
#sendBtn { background: var(--teal-ink); color: #fff; border-color: var(--teal-ink); }
#sendBtn:hover { background: #106b66; }
#sendBtn:disabled { background: #cbd5e1; border-color: #cbd5e1; cursor: not-allowed; }
.hint { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: .64rem; color: var(--muted); margin-top: 7px; }

/* Painel de documento */
.dpan { flex: 1; overflow-y: auto; padding: var(--s6); display: flex; flex-direction: column; gap: var(--s3); max-width: 820px; }
.dpan h2 { font-size: var(--t-md); color: var(--ink); }
.dpan > p { font-size: var(--t-sm); color: var(--muted); }
.pdrop { position: relative; border: 2px dashed rgba(43,188,180,.35); border-radius: var(--r-md); padding: var(--s6); text-align: center; background: rgba(43,188,180,.04); transition: all .15s; }
.pdrop:hover { border-color: var(--teal); background: rgba(43,188,180,.08); }
.pdrop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pdrop p { font-size: var(--t-sm); color: var(--muted); }
.pdrop strong { color: var(--teal-ink); }
.pstat { display: none; font-size: var(--t-sm); padding: 8px 12px; border-radius: 8px; margin-top: 8px; }
.pstat.ld { display: block; background: var(--warn-bg); border: 1px solid #f2ddb3; color: #a56a12; }
.pstat.ok { display: block; background: var(--ok-bg); border: 1px solid #bfe6d3; color: var(--teal-ink); }
.pstat.no { display: block; background: var(--danger-bg); border: 1px solid #f3c6c2; color: #b3372e; }
.pdiv { display: flex; align-items: center; gap: 10px; margin: 10px 0; color: var(--muted); font-size: var(--t-xs); }
.pdiv::before, .pdiv::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
#docText { min-height: 200px; resize: vertical; line-height: 1.7; }
.drow { display: flex; gap: var(--s2); }

/* ---------- CTA "NOVO CASO" (SIDEBAR) ---------- */
.nav-cta {
  display: flex; align-items: center; justify-content: center; gap: var(--s2);
  width: 100%; padding: 11px var(--s3); margin-bottom: var(--s4);
  background: var(--gold); color: var(--navy); border: none; border-radius: 9px;
  font-family: var(--f-body); font-size: var(--t-sm); font-weight: 700;
  letter-spacing: .01em; box-shadow: 0 2px 0 rgba(0,0,0,.06); transition: all .15s;
}
.nav-cta:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(201,162,39,.35); }
.nav-cta .ico { font-size: 1.05rem; font-weight: 400; }

/* ---------- DASHBOARD PREMIUM ---------- */
.dash { max-width: 1200px; margin: 0 auto; padding: var(--s8) var(--s8) var(--s10); }
.dash-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s8); flex-wrap: wrap; }
.dash-hero .greet { flex: 1; min-width: 280px; }
.dash-hero h1 { font-size: var(--t-xl); margin-top: 4px; }
.dash-hero p { color: var(--muted); margin-top: var(--s2); font-size: var(--t-sm); }
.dash-cta { display: inline-flex; align-items: center; gap: var(--s2); background: var(--teal-ink); color: #fff; border: none; padding: 12px 22px; border-radius: 10px; font-family: var(--f-body); font-size: var(--t-sm); font-weight: 600; box-shadow: var(--shadow-md); transition: all .15s; }
.dash-cta:hover { background: #106b66; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(20,130,124,.3); }
.dash-cta .plus { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; background: rgba(255,255,255,.18); border-radius: 5px; font-weight: 400; }

/* KPIs */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); margin-bottom: var(--s8); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s4) var(--s5); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); }
.kpi .lab { font-family: var(--f-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kpi .val { font-family: var(--f-display); font-size: 1.7rem; font-weight: 700; color: var(--ink); line-height: 1.1; margin-top: 6px; }
.kpi .val.zero { color: #cbd5e1; }
.kpi .sub { font-size: .68rem; color: var(--muted); margin-top: 4px; }

/* Seções (Casos Recentes, Favoritos, etc.) */
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); margin-bottom: var(--s8); }
.dash-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.dash-sec-hd { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line-soft); }
.dash-sec-hd h3 { font-family: var(--f-display); font-size: .98rem; color: var(--ink); }
.dash-sec-hd a { font-size: .72rem; color: var(--teal-ink); }
.dash-sec-body { padding: var(--s5); }
.empty { text-align: center; padding: var(--s5) var(--s3); color: var(--muted); }
.empty .icon { font-size: 1.6rem; opacity: .35; margin-bottom: var(--s2); }
.empty p { font-size: .82rem; margin-bottom: var(--s3); }
.empty .empty-cta { font-size: .74rem; color: var(--teal-ink); background: none; border: none; font-weight: 600; cursor: pointer; }
.empty .empty-cta:hover { text-decoration: underline; }

/* Grid de workflows (agora subordinado) */
.dash-wf-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--s4); }
.dash-wf-title h2 { font-size: var(--t-md); }
.dash-wf-title .subt { color: var(--muted); font-size: .78rem; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s3); margin-bottom: var(--s8); }
.wf-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s5); display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm); transition: all .16s; cursor: pointer; position: relative; }
.wf-card:hover { border-color: rgba(201,162,39,.5); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.wf-ico { font-size: 1.5rem; }
.wf-title { font-family: var(--f-display); font-weight: 700; font-size: 1rem; color: var(--ink); }
.wf-desc { font-size: .8rem; color: var(--muted); line-height: 1.5; }
.wf-cta { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .06em; color: var(--gold-ink); margin-top: 8px; text-transform: uppercase; font-weight: 600; }
.wf-cta::after { content: ' →'; }

/* Card do Assistente — discreto, no rodapé */
.dash-assist { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.dash-assist .txt { display: flex; align-items: center; gap: var(--s3); }
.dash-assist .txt .robo { font-size: 1.3rem; opacity: .7; }
.dash-assist .txt strong { font-size: .9rem; color: var(--ink); }
.dash-assist .txt p { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.dash-assist .btn-ghost { padding: 7px 14px; font-size: .78rem; }

/* ---------- TOOLBAR STICKY ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 10px var(--s6); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.toolbar .ctx { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: var(--s3); }
.toolbar .ctx strong { color: var(--gold-ink); font-family: var(--f-body); font-size: .78rem; letter-spacing: 0; text-transform: none; font-weight: 600; }
.toolbar .tb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid transparent; color: var(--ink-soft); padding: 7px 11px; border-radius: 7px; font-size: .78rem; transition: all .12s; }
.tb-btn:hover { background: #f0f3f7; color: var(--ink); }
.tb-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.tb-spacer { margin-left: auto; }

/* ---------- SELETOR "NOVO CASO" ---------- */
.nc { max-width: 900px; margin: 0 auto; padding: var(--s8) var(--s6); }
.nc h1 { font-size: var(--t-xl); }
.nc > p { color: var(--muted); margin-top: var(--s2); margin-bottom: var(--s6); }
.nc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s3); }
.nc-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--r-md); padding: var(--s5); cursor: pointer; transition: all .16s; box-shadow: var(--shadow-sm); }
.nc-card:hover { border-left-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.nc-card .ico { font-size: 1.4rem; margin-bottom: 8px; }
.nc-card h3 { font-family: var(--f-display); font-size: .98rem; color: var(--ink); margin-bottom: 4px; }
.nc-card p { font-size: .78rem; color: var(--muted); line-height: 1.5; }
.nc-card .step { font-family: var(--f-mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); margin-top: var(--s3); font-weight: 600; }

/* ============================================================
   SPRINT 3 — WORKFLOW DO CASO
   ============================================================ */

/* ---------- STEPPER ---------- */
.stepper {
  display: flex; align-items: center; gap: 4px;
  padding: 14px var(--s6); background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.stepper-item {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: none; color: var(--muted);
  font-family: var(--f-body); font-size: .8rem; font-weight: 500;
  padding: 6px 10px; border-radius: 20px; white-space: nowrap;
  transition: all .15s;
}
.stepper-item:not(:disabled):hover { background: #eef2f7; color: var(--ink); }
.stepper-item:disabled { cursor: not-allowed; opacity: .55; }
.stepper-item .stepper-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: #e5e9ef; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: .68rem; font-weight: 600;
  transition: all .2s;
}
.stepper-item.done .stepper-num { background: var(--ok); color: #fff; }
.stepper-item.cur { color: var(--ink); font-weight: 600; }
.stepper-item.cur .stepper-num { background: var(--gold); color: var(--navy); box-shadow: 0 0 0 3px rgba(201,162,39,.25); }
.stepper-line { flex: 0 0 20px; height: 1px; background: var(--line); }

/* ---------- STEP LAYOUT ---------- */
.step-wrap { padding: 0; }
.step {
  max-width: 920px; margin: 0 auto;
  padding: var(--s8) var(--s6) var(--s10);
  display: flex; flex-direction: column; gap: var(--s6);
}
.step-hd .eyebrow { color: var(--gold-ink); }
.step-hd h2 { font-size: var(--t-lg); margin-top: 4px; }
.step-hd p { color: var(--muted); margin-top: var(--s2); font-size: .88rem; max-width: 640px; }
.step-body { display: flex; flex-direction: column; gap: var(--s4); }
.step-foot {
  display: flex; align-items: center; gap: var(--s3);
  padding-top: var(--s5); margin-top: var(--s3);
  border-top: 1px solid var(--line-soft);
}

/* ---------- UPLOAD (drag & drop) ---------- */
.up-drop {
  position: relative; border: 2px dashed #cdd6e0; background: #fafbfd;
  border-radius: var(--r-lg); padding: var(--s10) var(--s6); text-align: center;
  transition: all .2s;
}
.up-drop.over { border-color: var(--teal); background: rgba(43,188,180,.06); transform: scale(1.005); }
.up-drop.processing { border-style: solid; border-color: var(--gold); background: rgba(201,162,39,.05); }
.up-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.up-icon { font-size: 2.2rem; opacity: .55; margin-bottom: var(--s3); }
.up-title { font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.up-sub { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.up-sub strong { color: var(--teal-ink); }
.up-bar { width: 100%; max-width: 340px; height: 6px; background: #e5e9ef; border-radius: 3px; margin: 12px auto 0; overflow: hidden; }
.up-bar-fill { height: 100%; background: var(--gold); border-radius: 3px; transition: width .25s ease; }

.up-list { display: flex; flex-direction: column; gap: 8px; margin-top: var(--s4); }
.up-item {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 10px 12px; box-shadow: var(--shadow-sm);
}
.up-thumb { width: 40px; height: 40px; flex-shrink: 0; background: #f4f6f9; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; overflow: hidden; }
.up-thumb img { width: 100%; height: 100%; object-fit: cover; }
.up-meta { flex: 1; min-width: 0; }
.up-name { font-size: .86rem; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-info { font-family: var(--f-mono); font-size: .68rem; color: var(--muted); margin-top: 2px; }
.up-remove {
  width: 28px; height: 28px; border-radius: 6px; background: transparent; border: none;
  color: var(--muted); cursor: pointer; font-size: .8rem; transition: all .12s;
}
.up-remove:hover { background: var(--danger-bg); color: var(--danger); }

/* ---------- ORGANIZAÇÃO (por categoria) ---------- */
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.cat-hd { display: flex; align-items: center; gap: 10px; padding: 11px var(--s5); border-bottom: 1px solid var(--line-soft); background: #fafbfd; }
.cat-ico { font-size: 1.1rem; }
.cat-title { font-family: var(--f-display); font-weight: 700; font-size: .92rem; color: var(--ink); flex: 1; }
.cat-badge { font-family: var(--f-mono); font-size: .62rem; padding: 3px 9px; border-radius: 10px; background: rgba(201,162,39,.14); color: var(--gold-ink); font-weight: 600; }
.cat-body { padding: 10px var(--s5); display: flex; flex-direction: column; gap: 6px; }
.cat-empty { font-size: .78rem; color: var(--muted); font-style: italic; padding: 6px 0; }
.cat-doc { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.cat-doc-name { flex: 1; font-size: .82rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-doc-sel { font-family: var(--f-body); font-size: .74rem; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-soft); }
.cat-doc-rm { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: .78rem; }
.cat-doc-rm:hover { background: var(--danger-bg); color: var(--danger); }

/* ---------- CHECKLIST ---------- */
.chk-summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.chk-pct { font-family: var(--f-display); font-size: 2rem; font-weight: 700; color: var(--gold); line-height: 1; }
.chk-pbar { flex: 1; max-width: 320px; height: 8px; background: #e5e9ef; border-radius: 4px; overflow: hidden; }
.chk-pbar-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); border-radius: 4px; transition: width .4s ease; }

.chk-list { display: flex; flex-direction: column; gap: 6px; }
.chk-item {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid transparent;
  border-radius: var(--r-md); padding: 10px var(--s5); box-shadow: var(--shadow-sm);
}
.chk-ok { border-left-color: var(--ok); }
.chk-wa { border-left-color: var(--warn); }
.chk-no { border-left-color: var(--danger); }
.chk-ic { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; flex-shrink: 0; }
.chk-ok .chk-ic, .chk-legend .chk-ic.ok { background: var(--ok-bg); color: var(--ok); }
.chk-wa .chk-ic, .chk-legend .chk-ic.wa { background: var(--warn-bg); color: var(--warn); }
.chk-no .chk-ic, .chk-legend .chk-ic.no { background: var(--danger-bg); color: var(--danger); }
.chk-txt { flex: 1; min-width: 0; }
.chk-lb { font-size: .88rem; color: var(--ink); font-weight: 500; }
.chk-crit { font-family: var(--f-mono); font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; color: var(--danger); background: var(--danger-bg); padding: 2px 6px; border-radius: 3px; margin-left: 6px; font-weight: 600; }
.chk-sub { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.chk-st { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.chk-legend { display: flex; gap: var(--s5); font-size: .74rem; color: var(--muted); flex-wrap: wrap; margin-top: var(--s3); }
.chk-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- ANÁLISE (loading) ---------- */
.an-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--s5); padding: var(--s8) var(--s4); }
.an-orbit { position: relative; width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; }
.an-core { font-size: 1.6rem; color: var(--gold); z-index: 2; animation: anPulse 2s ease-in-out infinite; }
.an-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--gold); border-right-color: var(--teal); animation: anSpin 1.4s linear infinite; }
@keyframes anSpin { to { transform: rotate(360deg); } }
@keyframes anPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: .8; } }
.an-msg { font-family: var(--f-display); font-size: 1rem; color: var(--ink); text-align: center; min-height: 1.6em; }
.an-bar { width: 100%; max-width: 320px; height: 5px; background: #e5e9ef; border-radius: 3px; overflow: hidden; }
.an-bar-fill { height: 100%; background: var(--gold); transition: width .35s ease; }
.an-pct { font-family: var(--f-mono); font-size: .74rem; color: var(--muted); }
.an-log { list-style: none; padding: 0; margin: var(--s4) 0 0; max-width: 420px; width: 100%; }
.an-log li { font-size: .78rem; color: var(--muted); padding: 4px 0; display: flex; align-items: center; gap: 8px; animation: anFade .3s ease; }
.an-check { color: var(--ok); font-weight: 700; }
@keyframes anFade { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- RELATÓRIO ---------- */
.rep-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; }
.rep-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rep-actions .btn { padding: 8px 14px; font-size: .78rem; }
.rep {
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--gold);
  border-radius: var(--r-md); padding: var(--s8);
  box-shadow: var(--shadow-md);
}
.rep-sec { margin-bottom: var(--s6); }
.rep-sec:last-child { margin-bottom: 0; }
.rep-sec h3 {
  font-family: var(--f-display); font-size: 1.02rem; color: var(--gold-ink);
  padding-bottom: 6px; border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
}
.rep-sec p { font-size: .9rem; color: var(--ink); line-height: 1.75; margin-bottom: 8px; }
.rep-sec ul, .rep-sec ol { padding-left: 22px; margin: 6px 0 10px; }
.rep-sec li { font-size: .88rem; color: var(--ink); line-height: 1.7; margin-bottom: 4px; }
.rep-time li strong { font-family: var(--f-mono); color: var(--gold-ink); font-weight: 600; margin-right: 6px; }
.rep-pend-ausente { color: var(--danger); }
.rep-pend-pendente { color: var(--warn); }
.rep-cat { margin-bottom: 10px; }
.rep-cat strong { font-family: var(--f-display); font-size: .92rem; color: var(--ink); }
.rep-cat ul { padding-left: 22px; margin-top: 4px; }
.rep-risk li::marker { color: var(--danger); }

/* ---------- MEUS CASOS ---------- */
.casos-list { display: flex; flex-direction: column; gap: 10px; }
.caso-row {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px var(--s5); box-shadow: var(--shadow-sm);
  transition: all .14s;
}
.caso-row:hover { border-color: rgba(201,162,39,.5); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.caso-fav { background: transparent; border: none; color: var(--gold); font-size: 1.15rem; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.caso-fav:hover { background: rgba(201,162,39,.12); }
.caso-main { flex: 1; min-width: 0; cursor: pointer; }
.caso-title { font-family: var(--f-display); font-weight: 700; font-size: .96rem; color: var(--ink); }
.caso-meta { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.caso-sub { margin-top: 5px; font-size: .74rem; }
.caso-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .04em;
  background: rgba(201,162,39,.14); color: var(--gold-ink); font-weight: 600;
}
.caso-tag-concluido { background: rgba(31,157,87,.14); color: var(--ok); }
.caso-tag-analise, .caso-tag-relatorio { background: rgba(43,188,180,.14); color: var(--teal-ink); }
.caso-acts { display: flex; gap: 6px; }

/* Linhas de caso no Dashboard */
.dash-caso-list { display: flex; flex-direction: column; gap: 8px; }
.dash-caso {
  display: flex; align-items: center; gap: var(--s3); padding: 10px 4px;
  border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .12s;
}
.dash-caso:last-child { border-bottom: none; }
.dash-caso:hover { background: #fafbfd; }
.dash-caso-ico { width: 32px; height: 32px; border-radius: 50%; background: rgba(201,162,39,.12); color: var(--gold-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-caso-body { flex: 1; min-width: 0; }
.dash-caso-title { font-size: .86rem; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-caso-sub { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.dash-caso-arrow { color: var(--muted); font-size: .9rem; }

/* Card "Disponível" no Novo Caso */
.nc-card.nc-ready { border-left-color: var(--ok); }
.nc-card.nc-ready:hover { border-left-color: var(--ok); }
.nc-card.nc-ready .step { color: var(--ok); }
.wf-card.wf-ready { border-color: rgba(31,157,87,.35); }
.wf-card.wf-ready .wf-cta { color: var(--ok); }

/* ---------- DRAG OVERLAY DO ASSISTENTE ---------- */
.assist-drop-overlay {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(27,42,58,.9); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center;
  border: 3px dashed var(--gold);
  pointer-events: none;
}
.assist-drop-overlay.show { display: flex; }
.assist-drop-msg {
  color: var(--gold); font-family: var(--f-display); font-size: 1.4rem; font-weight: 700;
  padding: var(--s8); border: 2px solid rgba(201,162,39,.4); border-radius: var(--r-lg);
  background: rgba(27,42,58,.7);
}
.assist { position: relative; } /* garante o inset do overlay */

/* ============================================================
   RELEASE 0.4 — POLIMENTO PREMIUM
   Refinamentos de UX, microinterações, consistência visual
   e preview do Relatório Executivo em tela.
   ============================================================ */

/* ---------- CAPA PREMIUM DO RELATÓRIO (em tela) ---------- */
.rep-capa {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  padding: var(--s6) var(--s8);
  margin: calc(var(--s8) * -1) calc(var(--s8) * -1) var(--s6);
  border-radius: var(--r-md) var(--r-md) 0 0;
  border-bottom: 3px solid var(--gold);
  position: relative;
  overflow: hidden;
}
.rep-capa::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(201,162,39,.12) 0%, transparent 70%);
  pointer-events: none;
}
.rep-capa-brand { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: var(--s4); border-bottom: 1px solid rgba(255,255,255,.09); }
.rep-capa-mark { font-family: var(--f-display); font-size: 1.15rem; font-weight: 700; color: var(--gold); letter-spacing: .08em; }
.rep-capa-sub { font-family: var(--f-mono); font-size: .6rem; color: var(--teal); letter-spacing: .16em; text-transform: uppercase; margin-top: 3px; }
.rep-capa-office { text-align: right; }
.rep-capa-office-name { font-family: var(--f-display); font-size: .9rem; font-weight: 700; color: #fff; }
.rep-capa-office-sub { font-size: .7rem; color: var(--on-navy-mut); margin-top: 2px; }
.rep-capa-body { padding: var(--s5) 0; }
.rep-capa-body .eyebrow { color: var(--gold); letter-spacing: .18em; }
.rep-capa-title { font-family: var(--f-display); font-size: 1.6rem; font-weight: 700; color: #fff; margin: 6px 0 8px; line-height: 1.2; }
.rep-capa-subtitle { font-size: .92rem; color: var(--on-navy-mut); }
.rep-capa-meta {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--s3) var(--s5);
  padding-top: var(--s4); border-top: 1px solid rgba(255,255,255,.09);
}
.rep-capa-meta > div { display: flex; flex-direction: column; }
.rep-capa-meta .k { font-family: var(--f-mono); font-size: .58rem; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; }
.rep-capa-meta .v { font-size: .84rem; color: #fff; margin-top: 3px; }

@media (max-width: 720px) {
  .rep-capa-brand { flex-direction: column; gap: var(--s3); }
  .rep-capa-office { text-align: left; }
  .rep-capa-meta { grid-template-columns: 1fr 1fr; }
  .rep-capa-title { font-size: 1.3rem; }
}

/* ---------- CAPA PREMIUM DO RELATÓRIO (em tela) — fim ---------- */

/* ---------- MICROINTERAÇÕES GLOBAIS ---------- */
/* Transição suave e discreta em botões/cards de conteúdo. */
.btn, .hbtn, .tb-btn, .mbtn, .qb, .wf-card, .nc-card,
.dash-caso, .caso-row, .kpi, .dash-sec, .up-item, .cat, .chk-item, .rep-sec {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .12s ease;
}

/* Botão em loading — spinner discreto no lugar da label. */
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  border-radius: 50%; animation: btnSpin .7s linear infinite;
}
.btn-ghost.loading::after { border-color: rgba(27,42,58,.25); border-top-color: var(--ink); }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* Feedback ao salvar / concluir uma etapa (usado via classe .flash). */
@keyframes flashOk { 0% { background-color: rgba(31,157,87,.18); } 100% { background-color: transparent; } }
.flash-ok { animation: flashOk 1.2s ease-out; }

/* Aparição suave de conteúdo em views (view enter). */
@keyframes viewFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#view > * { animation: viewFadeIn .22s ease-out; }

/* Aparição escalonada dos cards no dashboard. */
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dash-grid .wf-card, .kpi-strip .kpi, .dash-cols .dash-sec {
  animation: cardIn .32s ease-out backwards;
}
.dash-grid .wf-card:nth-child(1) { animation-delay: .02s; }
.dash-grid .wf-card:nth-child(2) { animation-delay: .05s; }
.dash-grid .wf-card:nth-child(3) { animation-delay: .08s; }
.dash-grid .wf-card:nth-child(4) { animation-delay: .11s; }
.dash-grid .wf-card:nth-child(5) { animation-delay: .14s; }
.dash-grid .wf-card:nth-child(6) { animation-delay: .17s; }

/* Respeita reduced-motion (já ativo no base.css, mas reforço para as animações locais). */
@media (prefers-reduced-motion: reduce) {
  #view > *, .dash-grid .wf-card, .kpi-strip .kpi, .dash-cols .dash-sec { animation: none; }
}

/* ---------- CONSISTÊNCIA VISUAL — BOTÕES ---------- */
/* Padroniza altura e alinhamento; deixa botões visualmente irmãos. */
.btn { min-height: 38px; line-height: 1.2; }
.btn-ghost { background: var(--surface); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-primary:not(:disabled):hover { transform: translateY(-1px); }

/* Estados de foco unificados. */
.btn:focus-visible, .hbtn:focus-visible, .tb-btn:focus-visible, .nav-item:focus-visible,
.nav-cta:focus-visible, .wf-card:focus-visible, .nc-card:focus-visible,
.dash-cta:focus-visible, .qb:focus-visible, .mbtn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- UX DE UPLOAD REFINADA ---------- */
.up-drop {
  cursor: pointer;
  will-change: transform, background-color, border-color;
}
.up-drop:hover:not(.processing):not(.over) {
  border-color: rgba(43,188,180,.5);
  background: rgba(43,188,180,.03);
}
.up-drop.over {
  transform: scale(1.008);
  box-shadow: 0 0 0 4px rgba(43,188,180,.08);
}
.up-icon { transition: transform .3s ease; }
.up-drop:hover .up-icon { transform: translateY(-2px); }
.up-drop.processing .up-icon { animation: upPulse 1.4s ease-in-out infinite; }
@keyframes upPulse { 0%,100% { transform: scale(1); opacity: .55; } 50% { transform: scale(1.15); opacity: .85; } }

/* Barra de progresso mais elegante — gradiente animado. */
.up-bar-fill {
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
  background-size: 200% 100%;
  animation: upBarShine 2s linear infinite;
}
@keyframes upBarShine { 0% { background-position: 0% 0%; } 100% { background-position: 200% 0%; } }

/* Item de upload — entrada suave, cursor arrastável (preparado para reordenação futura). */
@keyframes upItemIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.up-item { animation: upItemIn .22s ease-out; }
.up-item:hover { border-color: rgba(43,188,180,.45); }
.up-item[draggable="true"] { cursor: grab; }
.up-item.dragging { opacity: .5; cursor: grabbing; }

/* ---------- CONSISTÊNCIA — SOMBRAS E CARTÕES ---------- */
.card, .dash-sec, .kpi, .caso-row, .cat, .up-item, .chk-item, .rep {
  transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}

/* ---------- PREVIEW DO RELATÓRIO EM TELA (SOJI-200) ---------- */
.rep-sec { margin-bottom: var(--s6); }

/* Bloco de síntese destacado */
.rep-sintese {
  background: linear-gradient(180deg, #fafbfd 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-md);
  padding: var(--s4) var(--s5);
  margin-bottom: var(--s5);
}
.rep-sintese p { font-size: .92rem; color: var(--ink); line-height: 1.7; margin: 0; }

/* Grade das 4 perguntas do executivo */
.rep-4perg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
  margin-bottom: var(--s5);
}
.rep-4perg > div {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: var(--s3) var(--s4);
}
.rep-4perg .eyebrow { display: block; margin-bottom: 4px; }
.rep-4perg p { font-size: .82rem; color: var(--ink-soft); line-height: 1.6; margin: 0; }

/* Callouts: Recomendação (colorido) + Confiança (neutro) */
.rep-callouts {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--s3);
  margin-top: var(--s3);
}
.rep-recom, .rep-conf {
  border-radius: var(--r-md);
  padding: var(--s4) var(--s5);
  display: flex; flex-direction: column; gap: 4px;
  min-height: 62px;
  justify-content: center;
}
.rep-recom { color: #fff; }
.rep-recom .lb { font-family: var(--f-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.rep-recom .vl { font-family: var(--f-display); font-size: 1.02rem; font-weight: 700; letter-spacing: .01em; }
.rep-conf {
  background: var(--surface);
  border: 1px solid var(--line);
}
.rep-conf .lb { font-family: var(--f-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }
.rep-conf .vl { font-family: var(--f-display); font-size: 1.02rem; font-weight: 700; }

/* Grid da Identificação — duas colunas de rótulo/valor */
.rep-ident-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2) var(--s5);
}
.rep-ident-row {
  display: flex; align-items: baseline; gap: var(--s3);
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.rep-ident-row .k {
  font-family: var(--f-mono);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-ink);
  min-width: 110px;
  flex-shrink: 0;
}
.rep-ident-row .v { font-size: .88rem; color: var(--ink); }

/* Timeline em tela */
.rep-time {
  list-style: none;
  padding: 0;
  border-left: 2px solid var(--line);
  margin-left: 6px;
}
.rep-time li {
  position: relative;
  padding: 6px 0 6px var(--s5);
  font-size: .88rem;
  color: var(--ink);
}
.rep-time li::before {
  content: '';
  position: absolute; left: -6px; top: 13px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.rep-time li strong { font-family: var(--f-mono); color: var(--gold-ink); font-size: .8rem; margin-right: 6px; }

/* Tabelas do relatório em tela — profissionais e responsivas */
.rep-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.rep-tbl th {
  background: var(--navy);
  color: #fff;
  font-family: var(--f-mono);
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  padding: 10px var(--s3);
  font-weight: 600;
}
.rep-tbl td {
  padding: 9px var(--s3);
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  vertical-align: top;
}
.rep-tbl tr:last-child td { border-bottom: none; }
.rep-tbl tr:nth-child(even) td { background: #fafbfd; }
.rep-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-family: var(--f-mono);
  font-size: .62rem;
  letter-spacing: .04em;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Blocos de análise */
.rep-bloco {
  margin-bottom: var(--s5);
  padding-bottom: var(--s4);
  border-bottom: 1px dashed var(--line-soft);
}
.rep-bloco:last-child { border-bottom: none; padding-bottom: 0; }
.rep-bloco h4 {
  font-family: var(--f-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.rep-bloco p { font-size: .88rem; color: var(--ink); line-height: 1.75; margin-bottom: 10px; }
.rep-parcial {
  background: #fafbfd;
  border-left: 3px solid var(--gold);
  padding: 10px var(--s4);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-top: 10px;
}
.rep-parcial .eyebrow { display: block; margin-bottom: 4px; color: var(--gold-ink); }
.rep-parcial p { font-size: .84rem; color: var(--ink-soft); margin: 0; line-height: 1.6; }

/* Limitações */
.rep-limit { padding-left: 22px; }
.rep-limit li { font-size: .84rem; color: var(--muted); line-height: 1.7; margin-bottom: 4px; }

/* Conclusão final — destacada */
.rep-conclusao {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
  border: 1px solid var(--gold);
  border-radius: var(--r-md);
  padding: var(--s6);
}
.rep-conclusao h3 { color: var(--navy); border-bottom-color: var(--gold); }
.rep-conclusao .eyebrow {
  display: block;
  margin: var(--s4) 0 6px;
  color: var(--gold-ink);
}
.rep-conclusao .eyebrow:first-of-type { margin-top: 0; }
.rep-conclusao p { font-size: .9rem; color: var(--ink); line-height: 1.75; margin: 0 0 4px; }
.rep-conclusao ul { padding-left: 22px; margin: 4px 0 0; }
.rep-conclusao li { font-size: .88rem; color: var(--ink); line-height: 1.65; margin-bottom: 4px; }

/* Container geral do relatório em tela */
.rep {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: var(--r-md);
  padding: var(--s8);
  box-shadow: var(--shadow-md);
}
.rep h3 {
  font-family: var(--f-display);
  font-size: 1.02rem;
  color: var(--gold-ink);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
}

/* Responsivo do relatório em tela */
@media (max-width: 800px) {
  .rep-4perg, .rep-callouts, .rep-ident-grid { grid-template-columns: 1fr; }
  .rep { padding: var(--s5); }
}

/* ---------- RESPONSIVO ---------- */
@media (max-width: 1000px) {
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .dash-cols { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .dgrid { grid-template-columns: 1fr; }
  .page, .dash, .nc, .step { padding: var(--s5); }
  .dash-hero { flex-direction: column; }
  .rep-hd { flex-direction: column; }
  .stepper { padding: 10px var(--s4); }
  .stepper-item .stepper-lb { display: none; }
  .stepper-item.cur .stepper-lb { display: inline; }
}
