/* ============================================================
   Portal de Atendimento CRM — folha de estilo
   Paleta e marca do Smart Process.
   ============================================================ */
:root {
  --smart-primary: #005daa;
  --smart-primary-dark: #004a87;
  --smart-primary-soft: #e8f1fa;
  --smart-bg: #f4f7fb;
  --smart-text: #243247;
  --smart-muted: #6b778c;
  --smart-border: #dce4ef;
  --smart-line: #eaf0f7;
  --ok: #1f8a4c;
  --warn: #c9761a;
  --danger: #b3323f;
  --shadow-sm: 0 1px 2px rgba(35, 65, 105, .06);
  --shadow-md: 0 6px 20px rgba(35, 65, 105, .08);
  --shadow-lg: 0 18px 46px rgba(35, 65, 105, .12);
  --r: .65rem;
  --r-lg: .9rem;
}

html { font-size: 15px; }
html, body { height: 100%; }
body { color: var(--smart-text); background: var(--smart-bg); display: flex; flex-direction: column; min-height: 100vh; }
h1, h2, h3, h4 { margin: 0; }
.container-portal { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; width: 100%; }

/* rodapé fixo ao final da página: acompanha o fim do conteúdo em telas altas
   e fica ancorado no fim da viewport quando o conteúdo é curto */
body > main { flex: 1 0 auto; }
.app-footer { flex: 0 0 auto; }

/* ---------- cabeçalho ---------- */
.brand-accent { height: 3px; background: linear-gradient(90deg, var(--smart-primary) 0%, #2f8fd8 60%, #7cc0ee 100%); }
.app-header { background: #fff; border-bottom: 1px solid var(--smart-border); box-shadow: var(--shadow-sm); position: relative; z-index: 20; }
.app-header-inner { align-items: center; display: flex; gap: 1rem; justify-content: space-between; min-height: 4.15rem; }
.app-brand { align-items: center; display: flex; gap: .85rem; min-width: 0; text-decoration: none; color: inherit; }
.app-brand img { display: block; height: 2.35rem; width: auto; }
.app-brand-divider { background: var(--smart-border); height: 1.8rem; width: 1px; }
.app-brand-name { display: block; line-height: 1.2; min-width: 0; }
.app-brand-name strong { display: block; font-size: .94rem; font-weight: 650; }
.app-brand-name small { color: var(--smart-muted); display: block; font-size: .74rem; }
.app-user { align-items: center; display: flex; gap: .75rem; }
.app-user-info { line-height: 1.25; text-align: right; }
.app-user-info strong { display: block; font-size: .87rem; font-weight: 650; }
.app-user-info small { color: var(--smart-muted); display: block; font-size: .75rem; max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { align-items: center; background: var(--smart-primary-soft); border: 1px solid #c9dcef; border-radius: 50%; color: var(--smart-primary-dark); display: inline-flex; flex: 0 0 auto; font-size: .8rem; font-weight: 700; height: 2.4rem; justify-content: center; width: 2.4rem; }
.btn-ghost { background: #fff; border: 1px solid var(--smart-border); border-radius: var(--r); color: var(--smart-text); cursor: pointer; font-size: .83rem; font-weight: 600; padding: .45rem .8rem; transition: .15s; }
.btn-ghost:hover { background: #f6f9fd; border-color: #c2d2e5; }

/* ---------- abas ---------- */
.app-tabs { background: #fff; border-bottom: 1px solid var(--smart-border); }
.app-tabs-inner { align-items: stretch; display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
.app-tabs-inner::-webkit-scrollbar { display: none; }
.app-tab { align-items: center; border-bottom: 3px solid transparent; color: var(--smart-muted); display: inline-flex; font-size: .88rem; font-weight: 600; gap: .5rem; padding: .85rem 1.05rem; text-decoration: none; transition: .15s; white-space: nowrap; }
.app-tab:hover { background: #f8fbfe; color: var(--smart-text); }
.app-tab.is-active { border-bottom-color: var(--smart-primary); color: var(--smart-primary-dark); }
.tab-count { background: #eef3f9; border-radius: 999px; color: var(--smart-muted); font-size: .72rem; font-weight: 700; min-width: 1.4rem; padding: .05rem .4rem; text-align: center; }
.app-tab.is-active .tab-count { background: var(--smart-primary-soft); color: var(--smart-primary-dark); }
.tab-badge { background: var(--danger); border-radius: 999px; color: #fff; font-size: .7rem; font-weight: 700; min-width: 1.35rem; padding: .08rem .38rem; text-align: center; }

.app-main { padding: 1.4rem 0 2rem; }
.app-footer { background: #fff; border-top: 1px solid var(--smart-border); color: var(--smart-muted); font-size: .78rem; padding: 1rem 0; text-align: center; }
.app-footer img { display: block; height: 2.4rem; margin: 0 auto .35rem; width: auto; }

/* ---------- avisos ---------- */
.action-banner { align-items: center; background: linear-gradient(100deg, #fff6e8 0%, #fffdf8 65%); border: 1px solid #f2d9ad; border-left: 4px solid #dd9a2a; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); display: flex; gap: 1rem; margin-bottom: 1.15rem; padding: .9rem 1.1rem; }
.action-banner-icon { align-items: center; background: #fbe7c4; border-radius: 50%; color: #8a5b0d; display: inline-flex; flex: 0 0 auto; font-size: 1.05rem; font-weight: 800; height: 2.4rem; justify-content: center; width: 2.4rem; }
.action-banner-text { flex: 1 1 auto; min-width: 0; }
.action-banner-text strong { display: block; font-size: .93rem; }
.action-banner-text p { color: #7a5c14; font-size: .83rem; margin: .1rem 0 0; }

.notice { border-radius: var(--r); font-size: .85rem; line-height: 1.5; margin-bottom: 1.1rem; padding: .8rem .95rem; }
.notice.info { background: #eef5fc; border: 1px solid #c9dcef; color: #194f7c; }
.notice.warn { background: #fff8e5; border: 1px solid #f0dcb8; color: #7a5c14; }
.notice.err { background: #fdeef0; border: 1px solid #f0c4c9; color: #8f2b36; }
.notice.ok { background: #eef7f1; border: 1px solid #c6e5d2; color: #186c3d; }

/* ---------- botões ---------- */
.btn-smart { align-items: center; background: var(--smart-primary); border: 1px solid var(--smart-primary); border-radius: var(--r); color: #fff; cursor: pointer; display: inline-flex; font-size: .86rem; font-weight: 650; gap: .45rem; justify-content: center; min-height: 2.65rem; padding: .5rem 1.05rem; text-decoration: none; transition: .15s; white-space: nowrap; }
.btn-smart:hover, .btn-smart:focus { background: var(--smart-primary-dark); border-color: var(--smart-primary-dark); color: #fff; }
.btn-smart.outline { background: #fff; color: var(--smart-primary-dark); }
.btn-smart.outline:hover, .btn-smart.outline:focus { background: var(--smart-primary-soft); color: var(--smart-primary-dark); }
.btn-smart.block { width: 100%; }

/* ---------- lista + detalhe ---------- */
.workspace { align-items: start; display: grid; gap: 1.1rem; grid-template-columns: minmax(300px, 25rem) minmax(0, 1fr); }
.panel { background: #fff; border: 1px solid var(--smart-border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.ws-list { display: flex; flex-direction: column; max-height: calc(100vh - 15rem); }
.ws-list-head { border-bottom: 1px solid var(--smart-line); flex: 0 0 auto; padding: .85rem .9rem; }
.ws-search { position: relative; }
.ws-search input { border: 1px solid #cfdbea; border-radius: var(--r); font-size: .86rem; min-height: 2.5rem; padding: .45rem .7rem .45rem 2.15rem; width: 100%; }
.ws-search input:focus { border-color: #86b7fe; box-shadow: 0 0 0 .2rem rgba(0, 93, 170, .13); outline: none; }
.ws-search::before { color: var(--smart-muted); content: "\2315"; font-size: 1.15rem; left: .7rem; position: absolute; top: 50%; transform: translateY(-52%); }
.ws-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; }
.chip { align-items: center; background: #fff; border: 1px solid var(--smart-border); border-radius: 999px; color: var(--smart-muted); cursor: pointer; display: inline-flex; font-size: .76rem; font-weight: 650; gap: .35rem; padding: .28rem .68rem; transition: .15s; white-space: nowrap; }
.chip:hover { border-color: #b9cbe0; color: var(--smart-text); }
.chip.is-on { background: var(--smart-primary-soft); border-color: #a8cbe8; color: var(--smart-primary-dark); }
.chip b { font-weight: 700; opacity: .75; }
.ws-list-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: .65rem; }
.ws-list-scroll::-webkit-scrollbar { width: 9px; }
.ws-list-scroll::-webkit-scrollbar-thumb { background: #d6e0ec; border: 3px solid #fff; border-radius: 9px; }

.ticket-card { background: #fff; border: 1px solid var(--smart-border); border-left: 4px solid var(--st, var(--smart-primary)); border-radius: var(--r); cursor: pointer; display: block; margin-bottom: .5rem; padding: .7rem .8rem; text-align: left; text-decoration: none; transition: .15s; width: 100%; color: inherit; }
.ticket-card:hover { border-color: #b9cbe0; box-shadow: var(--shadow-sm); color: inherit; transform: translateY(-1px); }
.ticket-card.is-selected { background: #f7fbff; border-color: #a8cbe8; box-shadow: inset 0 0 0 1px #d3e6f7; }
.ticket-card-top { align-items: center; display: flex; justify-content: space-between; margin-bottom: .2rem; }
.ticket-id { color: var(--smart-primary-dark); font-size: .75rem; font-weight: 750; }
.ticket-date { color: var(--smart-muted); font-size: .72rem; }
.ticket-subject { -webkit-box-orient: vertical; -webkit-line-clamp: 2; display: -webkit-box; font-size: .87rem; font-weight: 600; line-height: 1.35; margin-bottom: .4rem; overflow: hidden; }
.ticket-card-bottom { align-items: center; display: flex; gap: .5rem; justify-content: space-between; }
.ticket-status { align-items: center; color: var(--smart-muted); display: inline-flex; font-size: .74rem; gap: .35rem; min-width: 0; }
.ticket-status i { background: var(--st, var(--smart-primary)); border-radius: 50%; flex: 0 0 auto; height: .5rem; width: .5rem; }
.ticket-flag { background: #fdf1de; border-radius: 999px; color: #8a5b0d; font-size: .68rem; font-weight: 700; padding: .12rem .45rem; white-space: nowrap; }
.list-empty { color: var(--smart-muted); font-size: .85rem; padding: 2rem 1rem; text-align: center; }

.ws-detail { display: flex; flex-direction: column; max-height: calc(100vh - 15rem); }
.detail-head { border-bottom: 1px solid var(--smart-line); flex: 0 0 auto; padding: 1.05rem 1.25rem; }
.detail-head-top { align-items: flex-start; display: flex; gap: 1rem; justify-content: space-between; }
.detail-id { color: var(--smart-primary-dark); display: block; font-size: .75rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.detail-title { font-size: 1.14rem; font-weight: 650; line-height: 1.35; margin-top: .15rem; overflow-wrap: anywhere; }
.status-pill { align-items: center; background: color-mix(in srgb, var(--st, var(--smart-primary)) 11%, #fff); border: 1px solid color-mix(in srgb, var(--st, var(--smart-primary)) 34%, #fff); border-radius: 999px; color: color-mix(in srgb, var(--st, var(--smart-primary)) 78%, #2b3243); display: inline-flex; flex: 0 0 auto; font-size: .76rem; font-weight: 700; gap: .4rem; padding: .32rem .7rem; }
.status-pill i { background: var(--st, var(--smart-primary)); border-radius: 50%; height: .45rem; width: .45rem; }
.detail-meta { border-bottom: 1px solid var(--smart-line); display: grid; flex: 0 0 auto; gap: .15rem 1.25rem; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: .8rem 1.25rem; }
.detail-meta span { color: var(--smart-muted); display: block; font-size: .72rem; }
.detail-meta strong { display: block; font-size: .83rem; font-weight: 600; overflow-wrap: anywhere; }
.detail-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1.1rem 1.25rem 1.4rem; }
.detail-body::-webkit-scrollbar { width: 9px; }
.detail-body::-webkit-scrollbar-thumb { background: #d6e0ec; border: 3px solid #fff; border-radius: 9px; }
.block { margin-bottom: 1.5rem; }
.block:last-child { margin-bottom: 0; }
.block-title { align-items: center; color: var(--smart-text); display: flex; font-size: .78rem; font-weight: 750; gap: .5rem; letter-spacing: .07em; margin-bottom: .7rem; text-transform: uppercase; }
.block-title::after { background: var(--smart-line); content: ""; flex: 1 1 auto; height: 1px; }
.block-text { color: #3c4a60; font-size: .9rem; line-height: 1.6; white-space: pre-line; }
.detail-empty { align-items: center; color: var(--smart-muted); display: flex; flex-direction: column; justify-content: center; min-height: 26rem; padding: 2.5rem; text-align: center; }
.detail-empty-icon { align-items: center; background: var(--smart-primary-soft); border-radius: 50%; color: var(--smart-primary); display: inline-flex; font-size: 1.7rem; height: 3.6rem; justify-content: center; margin-bottom: .9rem; width: 3.6rem; }
.detail-empty strong { color: var(--smart-text); font-size: .98rem; }
.detail-empty p { font-size: .86rem; margin: .35rem 0 0; max-width: 24rem; }

/* ---------- formulários e links do atendimento ---------- */
.link-item { align-items: center; background: #fbfdff; border: 1px solid var(--smart-border); border-radius: var(--r); display: flex; gap: .9rem; justify-content: space-between; margin-bottom: .55rem; padding: .75rem .85rem; }
.link-item:last-child { margin-bottom: 0; }
.link-item.is-pending { background: #fffaf1; border-color: #f0dcb8; }
.link-item-main { min-width: 0; }
.link-item-main strong { display: block; font-size: .88rem; }
.link-item-meta { align-items: center; color: var(--smart-muted); display: flex; flex-wrap: wrap; font-size: .75rem; gap: .4rem; margin-top: .2rem; }
.tag { border-radius: 999px; font-size: .7rem; font-weight: 700; padding: .1rem .45rem; }
.tag.wait { background: #fdf1de; color: #8a5b0d; }
.tag.done { background: #e6f5ec; color: #186c3d; }
.tag.off { background: #eef1f5; color: #5d6b80; }

/* ---------- referências: OS e pedido ---------- */
.ref-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); }
.ref-card { background: #fbfdff; border: 1px solid var(--smart-border); border-radius: var(--r); padding: .7rem .8rem; }
.ref-label { align-items: center; color: var(--smart-muted); display: flex; font-size: .71rem; font-weight: 650; gap: .35rem; letter-spacing: .03em; text-transform: uppercase; }
.ref-value { display: block; font-size: 1rem; font-weight: 700; margin-top: .2rem; }
.ref-meta { color: var(--smart-muted); display: block; font-size: .75rem; line-height: 1.45; margin-top: .2rem; }
.ref-key { background: #f1f5fa; border-radius: .35rem; color: #4a5a72; display: block; font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: .68rem; letter-spacing: .02em; margin-top: .45rem; overflow-wrap: anywhere; padding: .3rem .42rem; }

/* ---------- notas fiscais ---------- */
.nf-item { background: #fbfdff; border: 1px solid var(--smart-border); border-radius: var(--r); display: flex; gap: .75rem; margin-bottom: .5rem; padding: .7rem .8rem; }
.nf-item:last-child { margin-bottom: 0; }
.nf-kind { align-self: flex-start; border-radius: 999px; flex: 0 0 auto; font-size: .67rem; font-weight: 750; letter-spacing: .04em; padding: .2rem .5rem; text-transform: uppercase; }
.nf-kind.venda { background: #e8f1fa; color: #004a87; }
.nf-kind.retorno { background: #efe9f8; color: #5b4291; }
.nf-kind.entrada { background: #e7eef6; color: #3c5c80; }
.nf-kind.peca { background: #e6f5ec; color: #186c3d; }
.nf-kind.servico { background: #fdf1de; color: #8a5b0d; }
.nf-main { min-width: 0; }
.nf-main strong { display: block; font-size: .9rem; }
.nf-main small { color: var(--smart-muted); display: block; font-size: .76rem; line-height: 1.45; margin-top: .12rem; }

/* ---------- rastreio ---------- */
.track { border: 1px solid var(--smart-border); border-radius: var(--r); margin-bottom: .7rem; overflow: hidden; }
.track:last-child { margin-bottom: 0; }
.track-head { align-items: center; background: #fbfdff; border-bottom: 1px solid var(--smart-line); display: flex; flex-wrap: wrap; gap: .6rem .8rem; justify-content: space-between; padding: .7rem .85rem; }
.track-code { display: block; font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: .94rem; font-weight: 700; letter-spacing: .03em; margin-top: .15rem; }
.track-eta { background: #f3f9ff; border-bottom: 1px solid var(--smart-line); color: #194f7c; font-size: .79rem; padding: .5rem .85rem; }
.track-eta.is-done { background: #f0f9f3; color: #186c3d; }
.track-eta.is-lost { background: #fdeef0; color: #8f2b36; }
.track-events { list-style: none; margin: 0; padding: .75rem .85rem; }
.track-events li { display: flex; gap: .75rem; padding-bottom: .75rem; position: relative; }
.track-events li:last-child { padding-bottom: 0; }
.track-events li::before { background: var(--smart-border); bottom: 0; content: ""; left: .31rem; position: absolute; top: 1rem; width: 2px; }
.track-events li:last-child::before { display: none; }
.track-dot { background: #c9d6e4; border-radius: 50%; flex: 0 0 auto; height: .7rem; margin-top: .32rem; width: .7rem; z-index: 1; }
.track-events li.is-current .track-dot { background: var(--smart-primary); box-shadow: 0 0 0 3px rgba(0, 93, 170, .16); }
.track-events li.is-done .track-dot { background: var(--ok); }
.track-events time { color: var(--smart-muted); display: block; font-size: .72rem; }
.track-events strong { display: block; font-size: .84rem; font-weight: 600; }
.track-events small { color: var(--smart-muted); display: block; font-size: .76rem; margin-top: .08rem; }

/* ---------- histórico de transferências ---------- */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: flex; gap: .8rem; padding-bottom: .9rem; position: relative; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before { background: var(--smart-border); bottom: 0; content: ""; left: .38rem; position: absolute; top: 1.1rem; width: 2px; }
.tl li:last-child::before { display: none; }
.tl-dot { background: var(--st, var(--smart-primary)); border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, var(--st, var(--smart-primary)) 20%, #fff); flex: 0 0 auto; height: .85rem; margin-top: .28rem; width: .85rem; z-index: 1; }
.tl-body { flex: 1 1 auto; min-width: 0; }
.tl-head { align-items: baseline; display: flex; flex-wrap: wrap; gap: .35rem .6rem; justify-content: space-between; }
.tl-head strong { font-size: .87rem; font-weight: 650; }
.tl-head time { color: var(--smart-muted); font-size: .73rem; white-space: nowrap; }
.tl-body small { color: var(--smart-muted); display: block; font-size: .77rem; margin-top: .12rem; }
.tl-now { background: var(--smart-primary-soft); border-radius: 999px; color: var(--smart-primary-dark); font-size: .65rem; font-weight: 750; letter-spacing: .05em; margin-left: .4rem; padding: .1rem .42rem; text-transform: uppercase; vertical-align: .1em; }

/* ---------- entrada pública ---------- */
.landing { padding: 2.2rem 0 2.5rem; }
.landing-hero { margin: 0 auto 1.6rem; max-width: 44rem; text-align: center; }
.eyebrow { color: var(--smart-primary); font-size: .74rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.landing-hero h1 { font-size: clamp(1.5rem, 3.4vw, 2.05rem); font-weight: 650; margin: .35rem 0 .5rem; }
.landing-hero p { color: var(--smart-muted); font-size: .95rem; line-height: 1.6; margin: 0; white-space: pre-line; }
.landing-grid { display: grid; gap: 1.1rem; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); margin: 0 auto; max-width: 60rem; }
.landing-grid.uma-coluna { grid-template-columns: minmax(0, 1fr); max-width: 34rem; }
.entry-card { background: #fff; border: 1px solid var(--smart-border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); display: flex; flex-direction: column; padding: 1.4rem; }
.entry-card.accent { background: linear-gradient(170deg, #f8fbff 0%, #fff 40%); border-color: #c9dcef; }
.entry-icon { align-items: center; background: var(--smart-primary-soft); border-radius: .7rem; color: var(--smart-primary-dark); display: inline-flex; font-size: 1.15rem; height: 2.6rem; justify-content: center; margin-bottom: .75rem; width: 2.6rem; }
.entry-card h2 { font-size: 1.05rem; font-weight: 650; }
.entry-card > p { color: var(--smart-muted); font-size: .86rem; line-height: 1.55; margin: .3rem 0 1rem; }
.entry-foot { border-top: 1px solid var(--smart-line); color: var(--smart-muted); font-size: .76rem; margin-top: auto; padding-top: .85rem; }
.landing-help { color: var(--smart-muted); font-size: .8rem; margin: 1.5rem auto 0; max-width: 60rem; text-align: center; }
.result-bar { align-items: center; background: #fff; border: 1px solid var(--smart-border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); display: flex; gap: 1rem; justify-content: space-between; margin-bottom: 1.1rem; padding: .75rem 1rem; }
.result-bar-main strong { display: block; font-size: .9rem; }
.result-bar-main small { color: var(--smart-muted); font-size: .78rem; }

/* ---------- campos ---------- */
.field { margin-bottom: .85rem; }
.field > label, .field-label { color: var(--smart-text); display: block; font-size: .79rem; font-weight: 650; margin-bottom: .3rem; }
.field .hint, .hint { color: var(--smart-muted); font-size: .75rem; margin-top: .28rem; }
.field input, .field select, .field textarea,
.portal-field input, .portal-field select, .portal-field textarea,
.form-control, .form-select {
  border: 1px solid #cfdbea; border-radius: var(--r); font-size: .88rem; min-height: 2.65rem; padding: .5rem .7rem; width: 100%;
}
.field textarea, .portal-field textarea { min-height: 6.5rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus,
.portal-field input:focus, .portal-field select:focus, .portal-field textarea:focus,
.form-control:focus, .form-select:focus {
  border-color: #86b7fe; box-shadow: 0 0 0 .2rem rgba(0, 93, 170, .13); outline: none;
}
.field input[readonly], .portal-field input[readonly], .form-control[readonly] { background: #f4f7fb; }
.req { color: var(--danger); font-weight: 700; }
.erro-campo { color: var(--danger); display: block; font-size: .76rem; margin-top: .25rem; }

.input-reveal { position: relative; }
.input-reveal input { padding-right: 2.9rem; }
.reveal-btn { align-items: center; background: none; border: 0; border-radius: .4rem; color: var(--smart-muted); cursor: pointer; display: flex; height: 2.1rem; justify-content: center; position: absolute; right: .32rem; top: 50%; transform: translateY(-50%); width: 2.1rem; }
.reveal-btn:hover { background: #eef3f9; color: var(--smart-text); }
.reveal-btn:focus-visible { box-shadow: 0 0 0 .2rem rgba(0, 93, 170, .2); outline: none; }
.reveal-btn svg { height: 1.15rem; width: 1.15rem; }
.reveal-btn .icon-off { display: none; }
.reveal-btn.is-on .icon-on { display: none; }
.reveal-btn.is-on .icon-off { display: block; }

/* ---------- fluxo por token ---------- */
.focus-header { background: #fff; border-bottom: 1px solid var(--smart-border); box-shadow: var(--shadow-sm); }
.focus-header-inner { align-items: center; display: flex; gap: 1rem; justify-content: space-between; min-height: 4.15rem; }
.focus-context { color: var(--smart-muted); font-size: .8rem; text-align: right; }
.focus-context strong { color: var(--smart-text); display: block; font-size: .86rem; }
.stepper { background: #fff; border-bottom: 1px solid var(--smart-border); }
.stepper-inner { display: flex; gap: .4rem; overflow-x: auto; padding: .65rem 0; scrollbar-width: none; }
.stepper-inner::-webkit-scrollbar { display: none; }
.step { align-items: center; color: var(--smart-muted); display: inline-flex; font-size: .82rem; font-weight: 600; gap: .5rem; padding: .2rem .55rem; white-space: nowrap; }
.step i { align-items: center; background: #eef2f7; border-radius: 50%; color: var(--smart-muted); display: inline-flex; font-size: .73rem; font-style: normal; font-weight: 750; height: 1.55rem; justify-content: center; width: 1.55rem; }
.step.is-done { color: var(--smart-text); }
.step.is-done i { background: #e6f5ec; color: var(--ok); }
.step.is-current { color: var(--smart-primary-dark); }
.step.is-current i { background: var(--smart-primary); color: #fff; }
.step-sep { align-self: center; color: #c3d0e0; }
.focus-main { padding: 1.8rem 0 2.5rem; }
.focus-card { background: #fff; border: 1px solid var(--smart-border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); margin: 0 auto; max-width: 44rem; overflow: hidden; }
.focus-card.wide { max-width: 52rem; }
.focus-card.plana { box-shadow: var(--shadow-md); }
.focus-card-head { border-bottom: 1px solid var(--smart-line); padding: 1.35rem 1.6rem 1.15rem; }
.focus-card-head h1 { font-size: 1.25rem; font-weight: 650; margin-top: .25rem; }
.focus-card-head p { color: var(--smart-muted); font-size: .88rem; line-height: 1.55; margin: .4rem 0 0; white-space: pre-line; }
.portal-html { color: var(--smart-muted); font-size: .88rem; line-height: 1.55; margin-top: .4rem; overflow-wrap: anywhere; }
.portal-html > :first-child { margin-top: 0; }
.portal-html > :last-child { margin-bottom: 0; }
.portal-html p { margin: 0 0 .5rem; white-space: normal; }
.portal-html img, .portal-html video, .portal-html iframe { height: auto; max-width: 100%; }
.portal-html blockquote { border-left: 4px solid var(--smart-line); margin: .5rem 0; padding-left: .85rem; }
.portal-html pre, .portal-html .ql-code-block { background: #f4f6f8; border-radius: .35rem; overflow-x: auto; padding: .65rem; white-space: pre-wrap; }
.portal-html .ql-align-center { text-align: center; }
.portal-html .ql-align-right { text-align: right; }
.portal-html .ql-align-justify { text-align: justify; }
.portal-html .ql-direction-rtl { direction: rtl; text-align: inherit; }
.portal-html .ql-size-small { font-size: .75em; }
.portal-html .ql-size-large { font-size: 1.5em; }
.portal-html .ql-size-huge { font-size: 2.5em; }
.portal-html .ql-font-serif { font-family: Georgia, 'Times New Roman', serif; }
.portal-html .ql-font-monospace { font-family: Consolas, Monaco, monospace; }
.portal-html .ql-indent-1 { padding-left: 3em; }
.portal-html .ql-indent-2 { padding-left: 6em; }
.portal-html .ql-indent-3 { padding-left: 9em; }
.portal-html .ql-indent-4 { padding-left: 12em; }
.portal-html .ql-indent-5 { padding-left: 15em; }
.portal-html .ql-indent-6 { padding-left: 18em; }
.portal-html .ql-indent-7 { padding-left: 21em; }
.portal-html .ql-indent-8 { padding-left: 24em; }
.portal-html-conclusao { margin: .6rem auto 0; max-width: 30rem; }
.focus-card-body { padding: 1.5rem 1.6rem; }
.focus-card-foot { align-items: center; background: #fafcff; border-top: 1px solid var(--smart-line); display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; padding: .9rem 1.6rem; }
.focus-card-foot .spacer { color: var(--smart-muted); font-size: .78rem; margin-right: auto; }
.summary-strip { background: #f7fafd; border: 1px solid var(--smart-border); border-radius: var(--r); display: grid; gap: .6rem 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1.25rem; padding: .85rem 1rem; }
.summary-strip span { color: var(--smart-muted); display: block; font-size: .73rem; }
.summary-strip strong { display: block; font-size: .87rem; font-weight: 600; }
.result-icon { align-items: center; border-radius: 50%; display: inline-flex; font-size: 2rem; height: 4.2rem; justify-content: center; margin-bottom: .9rem; width: 4.2rem; }
.result-icon.ok { background: #e6f5ec; color: var(--ok); }
.result-icon.err { background: #fdeef0; color: var(--danger); }

/* ---------- campos adicionais do formulário externo ---------- */
.portal-field { border-bottom: 1px solid var(--smart-line); padding: 1.05rem 0; }
.portal-field:first-of-type { padding-top: 0; }
.portal-field:last-of-type { border-bottom: 0; }
.portal-file-picker { align-items: center; display: flex; flex-wrap: wrap; gap: .7rem; }
.portal-file-input { height: 1px; opacity: 0; overflow: hidden; position: absolute; width: 1px; }
.portal-file-input:focus + .portal-file-button { box-shadow: 0 0 0 .2rem rgba(0, 93, 170, .18); }
.portal-file-input:disabled + .portal-file-button { opacity: .65; pointer-events: none; }
.portal-file-name { color: var(--smart-muted); font-size: .83rem; overflow-wrap: anywhere; }
.portal-multiselect { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
label.portal-multiselect-option { align-items: center; border: 1px solid #cfdbea; border-radius: var(--r); color: var(--smart-text); cursor: pointer; display: flex; font-size: .86rem; font-weight: 500; gap: .6rem; line-height: 1.35; margin: 0; min-height: 2.9rem; padding: .55rem .75rem; transition: .15s; }
label.portal-multiselect-option:hover { background: #f6fafe; border-color: #a8cbe8; }
label.portal-multiselect-option:has(input:checked) { background: #eef5fc; border-color: var(--smart-primary); }
.portal-multiselect-option input[type="checkbox"] { accent-color: var(--smart-primary); flex: 0 0 auto; height: 1.15rem; margin: 0; min-height: 0; width: 1.15rem; }
.portal-multiselect-option span { flex: 1 1 auto; min-width: 0; }
.file-current { color: var(--smart-muted); font-size: .83rem; }
.read-only-note { background: #fff8e5; border: 1px solid #ffe3a3; border-radius: var(--r); color: #775b13; font-size: .85rem; padding: .8rem .95rem; }

/* ---------- responsivo ---------- */
@media (max-width: 1050px) {
  .workspace { grid-template-columns: 1fr; }
  .ws-list { max-height: 24rem; }
  .ws-detail { max-height: none; }
  .landing-grid { grid-template-columns: 1fr; }
  .detail-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .app-header-inner, .focus-header-inner { min-height: 3.6rem; }
  .app-brand img { height: 2.1rem; }
  .app-brand-divider, .app-brand-name, .app-user-info { display: none; }
  .detail-meta { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr; }
  .focus-card-foot { align-items: stretch; flex-direction: column-reverse; }
  .focus-card-foot .btn-smart { width: 100%; }
  .focus-card-foot .spacer { margin: 0; text-align: center; }
  .track-head { align-items: flex-start; flex-direction: column; }
  .action-banner { align-items: flex-start; flex-direction: column; }
}
