/* ==========================================================================
   Conecta Jurídico — componentes reutilizáveis (v2)
   ========================================================================== */

:root { --danger-solid: #c4283a; --danger-solid-hover: #a81f2f; --success-solid: #12804f; --success-solid-hover: #0d6a40; }

/* ---------- Botões ---------- */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: var(--h); padding: 0 1.05rem;
  border-radius: 11px; border: 1px solid transparent;
  font-size: .875rem; font-weight: 600; line-height: 1; white-space: nowrap;
  color: var(--text); background: transparent;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .06s;
  user-select: none; cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn .i { width: 1.0625rem; height: 1.0625rem; }

.btn--primary { background: var(--brand); color: var(--on-brand); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(0, 30, 70, .28); }
.btn--primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn--primary:active { background: var(--brand-active); }
.btn--secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); box-shadow: var(--sh-1); }
.btn--secondary:hover { background: var(--surface-2); border-color: var(--text-faint); }
.btn--soft { background: var(--brand-soft); color: var(--brand-soft-text); }
.btn--soft:hover { background: color-mix(in srgb, var(--brand-soft) 80%, var(--brand)); }
.btn--ghost { color: var(--text-2); }
.btn--ghost:hover { background: var(--sunken); color: var(--text); }
.btn--danger { background: var(--danger-solid); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(120, 10, 25, .3); }
.btn--danger:hover { background: var(--danger-solid-hover); color: #fff; }
.btn--danger-soft { background: var(--danger-bg); color: var(--danger); }
.btn--danger-soft:hover { background: color-mix(in srgb, var(--danger-bg) 78%, var(--danger)); }
.btn--success { background: var(--success-solid); color: #fff; }
.btn--success:hover { background: var(--success-solid-hover); color: #fff; }
.btn--sm { --h: 34px; padding: 0 .8rem; font-size: .8125rem; border-radius: 9px; gap: .4rem; }
.btn--sm .i { width: .9375rem; height: .9375rem; }
.btn--lg { --h: 48px; padding: 0 1.4rem; font-size: .9375rem; border-radius: 13px; }
.btn--block { width: 100%; }
.btn--icon { width: var(--h); padding: 0; }
.btn.is-loading { pointer-events: none; opacity: .8; }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: .8125rem; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: .35rem; }
.label .req { color: var(--danger); font-weight: 700; }
.label .opt { font-weight: 500; color: var(--text-faint); }
.hint { font-size: .75rem; color: var(--text-3); line-height: 1.4; }
.field-error { font-size: .75rem; color: var(--danger); font-weight: 600; display: flex; align-items: center; gap: .3rem; }

.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: .55rem .85rem;
  border-radius: 11px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
  font-size: .9rem; line-height: 1.4;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px var(--ring); }
.input[disabled], .select[disabled], .textarea[disabled] { background: var(--sunken); color: var(--text-3); cursor: not-allowed; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.textarea { min-height: 104px; resize: vertical; }
.input--sm, .select--sm { min-height: 36px; padding: .35rem .7rem; font-size: .8125rem; border-radius: 9px; }

.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; background-size: 1rem;
}
:root[data-theme='dark'] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e9db4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.select option { background: var(--surface); color: var(--text); }

.input-icon { position: relative; }
.input-icon > .i { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: var(--text-3); pointer-events: none; }
.input-icon > .input { padding-left: 2.5rem; }
.input-icon > .input-icon__end { position: absolute; right: 6px; top: 50%; translate: 0 -50%; }

input[type='checkbox'], input[type='radio'] { accent-color: var(--brand); width: 1.0625rem; height: 1.0625rem; flex: none; cursor: pointer; margin: 0; }
.check { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; font-size: .875rem; color: var(--text); line-height: 1.4; }
.check input { margin-top: .12rem; }
.check--box { padding: .75rem .9rem; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); transition: border-color .15s, background .15s; }
.check--box:hover { border-color: var(--text-faint); }
.check--box:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
:root[data-theme='dark'] .check--box:has(input:checked) { border-color: var(--link); }

/* cartão de escolha (radio estilizado) */
.choice { position: relative; display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 1.05rem; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.choice:hover { border-color: var(--line-strong); box-shadow: var(--sh-1); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
:root[data-theme='dark'] .choice:has(input:checked) { border-color: var(--link); }
.choice:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
.choice__icon { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--sunken); color: var(--text-2); transition: background .15s, color .15s; }
.choice:has(input:checked) .choice__icon { background: var(--brand); color: #fff; }
.choice__title { font-weight: 650; font-size: .9rem; line-height: 1.3; color: var(--text); }
.choice__text { margin-top: 2px; font-size: .8125rem; color: var(--text-3); line-height: 1.4; }
.choice__tick { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; transition: all .15s; }
.choice:has(input:checked) .choice__tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.choice__tick .i { width: 12px; height: 12px; stroke-width: 3; }

/* ---------- Cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.card--flat { box-shadow: none; }
.card__head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.card__title { font-size: .9375rem; font-weight: 650; }
.card__sub { font-size: .8125rem; color: var(--text-3); margin-top: 1px; }
.card__body { padding: 1.25rem; }
.card__foot { padding: .85rem 1.25rem; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card-pad { padding: 1.25rem; }
.rail-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .75rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); margin-bottom: .85rem; }

/* ---------- Chips, status, risco, normas ---------- */
.chip { display: inline-flex; align-items: center; gap: .38rem; height: 26px; padding: 0 .65rem; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--sunken); color: var(--text-2); white-space: nowrap; }
.chip .i { width: .8125rem; height: .8125rem; stroke-width: 2.1; }
.chip--outline { background: transparent; border: 1px solid var(--line-strong); }
.chip--brand { background: var(--brand-soft); color: var(--brand-soft-text); }
.chip--gold { background: var(--gold-soft); color: var(--gold-text); }
.chip--danger { background: var(--danger-bg); color: var(--danger); }
.chip--success { background: var(--success-bg); color: var(--success); }
.chip--warning { background: var(--warning-bg); color: var(--warning); }

.status { --c-dot: var(--st-neutro-dot); --c-fg: var(--st-neutro-fg); --c-bg: var(--st-neutro-bg); display: inline-flex; align-items: center; gap: .45rem; height: 26px; padding: 0 .75rem 0 .65rem; border-radius: 99px; font-size: .75rem; font-weight: 650; color: var(--c-fg); background: var(--c-bg); white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c-dot); flex: none; }
.status[data-s='aberto'] { --c-dot: var(--st-aberto-dot); --c-fg: var(--st-aberto-fg); --c-bg: var(--st-aberto-bg); }
.status[data-s='analise'] { --c-dot: var(--st-analise-dot); --c-fg: var(--st-analise-fg); --c-bg: var(--st-analise-bg); }
.status[data-s='assinatura'] { --c-dot: var(--st-assinatura-dot); --c-fg: var(--st-assinatura-fg); --c-bg: var(--st-assinatura-bg); }
.status[data-s='concluido'] { --c-dot: var(--st-concluido-dot); --c-fg: var(--st-concluido-fg); --c-bg: var(--st-concluido-bg); }

.risk { --rk: var(--text-faint); --rk-fg: var(--text-3); display: inline-flex; align-items: center; gap: .5rem; font-size: .8125rem; font-weight: 600; color: var(--rk-fg); white-space: nowrap; }
.risk__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.risk__bars i { display: block; width: 4px; border-radius: 2px; background: var(--line-strong); }
.risk__bars i:nth-child(1) { height: 6px; } .risk__bars i:nth-child(2) { height: 9px; } .risk__bars i:nth-child(3) { height: 12px; } .risk__bars i:nth-child(4) { height: 14px; }
.risk[data-level='baixo'] { --rk: var(--rk-baixo); --rk-fg: var(--rk-baixo-fg); }
.risk[data-level='medio'] { --rk: var(--rk-medio); --rk-fg: var(--rk-medio-fg); }
.risk[data-level='alto'] { --rk: var(--rk-alto); --rk-fg: var(--rk-alto-fg); }
.risk[data-level='critico'] { --rk: var(--rk-critico); --rk-fg: var(--rk-critico-fg); }
.risk[data-level='baixo'] i:nth-child(-n+1), .risk[data-level='medio'] i:nth-child(-n+2), .risk[data-level='alto'] i:nth-child(-n+3), .risk[data-level='critico'] i:nth-child(-n+4) { background: var(--rk); }

.norma { --n-fg: var(--text-2); --n-bg: var(--sunken); --n-dot: var(--text-faint); display: inline-flex; align-items: center; gap: .4rem; height: 26px; padding: 0 .7rem 0 .55rem; border-radius: 8px; font-size: .75rem; font-weight: 650; letter-spacing: .01em; color: var(--n-fg); background: var(--n-bg); white-space: nowrap; }
.norma .i { width: .875rem; height: .875rem; stroke-width: 2; }
.norma[data-n='01'] { --n-fg: var(--n01-fg); --n-bg: var(--n01-bg); --n-dot: var(--n01-dot); }
.norma[data-n='02'] { --n-fg: var(--n02-fg); --n-bg: var(--n02-bg); --n-dot: var(--n02-dot); }
.norma[data-n='03'] { --n-fg: var(--n03-fg); --n-bg: var(--n03-bg); --n-dot: var(--n03-dot); }
.norma[data-n='04'] { --n-fg: var(--n04-fg); --n-bg: var(--n04-bg); --n-dot: var(--n04-dot); }

/* ---------- Abas e segmentado ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1rem; font-size: .875rem; font-weight: 600; color: var(--text-3); white-space: nowrap; border-radius: 10px 10px 0 0; transition: color .15s, background .15s; }
.tab:hover { color: var(--text); background: var(--sunken); }
.tab[aria-selected='true'] { color: var(--brand-soft-text); }
:root[data-theme='dark'] .tab[aria-selected='true'] { color: var(--link); }
.tab[aria-selected='true']::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
:root[data-theme='dark'] .tab[aria-selected='true']::after { background: var(--link); }
.tab__count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--sunken); color: var(--text-2); font-size: .6875rem; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.tab[aria-selected='true'] .tab__count { background: var(--brand-soft); color: var(--brand-soft-text); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--sunken); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg__btn { display: inline-flex; align-items: center; gap: .45rem; height: 34px; padding: 0 .85rem; border-radius: 9px; font-size: .8125rem; font-weight: 600; color: var(--text-3); white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.seg__btn:hover { color: var(--text); }
.seg__btn[aria-pressed='true'], .seg__btn[aria-selected='true'] { background: var(--surface); color: var(--text); box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
.seg__n { font-size: .6875rem; font-weight: 700; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.seg__btn[aria-pressed='true'] .seg__n, .seg__btn[aria-selected='true'] .seg__n { color: var(--brand-soft-text); }
:root[data-theme='dark'] .seg__btn[aria-pressed='true'] .seg__n { color: var(--link); }

/* ---------- Menus suspensos ---------- */
.menu-wrap { position: relative; display: inline-block; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70;
  min-width: 220px; max-width: min(380px, 92vw);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--sh-3); padding: 6px;
  display: none; transform-origin: top right;
}
.menu--left { right: auto; left: 0; transform-origin: top left; }
.menu.is-open { display: block; animation: cj-pop .16s var(--ease); }
@keyframes cj-pop { from { opacity: 0; transform: translateY(-5px) scale(.98); } to { opacity: 1; transform: none; } }
.menu__label { padding: .55rem .75rem .3rem; font-size: .6875rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.menu__item { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .58rem .75rem; border-radius: 9px; font-size: .875rem; color: var(--text); text-align: left; font-weight: 500; transition: background .12s; }
.menu__item:hover { background: var(--sunken); text-decoration: none; }
.menu__item .i { color: var(--text-3); }
.menu__item--danger, .menu__item--danger .i { color: var(--danger); }
.menu__item--danger:hover { background: var(--danger-bg); }
.menu__sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ---------- Diálogos (<dialog>) ---------- */
.modal { padding: 0; border: 0; background: transparent; width: 100%; max-width: min(540px, calc(100vw - 32px)); color: var(--text); overflow: visible; }
.modal::backdrop { background: var(--overlay); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal[open] { animation: cj-modal-in .24s var(--ease); }
.modal[open]::backdrop { animation: cj-fade .24s ease; }
@keyframes cj-modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes cj-fade { from { opacity: 0; } to { opacity: 1; } }
.modal--sm { max-width: min(440px, calc(100vw - 32px)); }
.modal--lg { max-width: min(760px, calc(100vw - 32px)); }
.modal--xl { max-width: min(1120px, calc(100vw - 32px)); }
.modal__box { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-3); overflow: hidden; }
.modal__head { display: flex; align-items: flex-start; gap: .85rem; padding: 1.25rem 1.5rem .5rem; }
.modal__icon { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-soft-text); }
.modal__icon--danger { background: var(--danger-bg); color: var(--danger); }
.modal__icon--warning { background: var(--warning-bg); color: var(--warning); }
.modal__icon--success { background: var(--success-bg); color: var(--success); }
.modal__title { font: 600 1.25rem/1.25 var(--font-serif); letter-spacing: -.012em; padding-top: 2px; }
.modal__sub { margin-top: 4px; font-size: .875rem; color: var(--text-3); line-height: 1.45; }
.modal__close { margin-left: auto; width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--text-3); }
.modal__close:hover { background: var(--sunken); color: var(--text); }
.modal__body { padding: .75rem 1.5rem 1.4rem; overflow: auto; font-size: .9rem; color: var(--text-2); line-height: 1.55; }
.modal__foot { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; padding: 1rem 1.5rem; border-top: 1px solid var(--line); background: var(--surface-2); }

/* gaveta lateral */
.modal--drawer { position: fixed; inset: 0 0 0 auto; margin: 0; max-width: min(480px, 100vw); height: 100dvh; max-height: 100dvh; }
.modal--drawer .modal__box { height: 100%; max-height: 100%; border-radius: 0; border-width: 0 0 0 1px; }
.modal--drawer[open] { animation: cj-drawer-in .3s var(--ease); }
@keyframes cj-drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* visualizador de documentos */
.viewer__bar { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem .75rem 1.25rem; border-bottom: 1px solid var(--line); }
.viewer__name { font-weight: 650; font-size: .9375rem; min-width: 0; }
.viewer__count { font-size: .75rem; color: var(--text-3); }
.viewer__stage { position: relative; background: var(--sunken); height: min(78dvh, 820px); min-height: 360px; display: grid; }
.viewer__frame { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer__img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.viewer__nav { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--sh-2); z-index: 2; }
.viewer__nav:hover { background: var(--surface-2); }
.viewer__nav--prev { left: 14px; } .viewer__nav--next { right: 14px; }
.viewer__none { margin: auto; text-align: center; max-width: 360px; padding: 2rem; color: var(--text-3); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; display: flex; gap: .75rem; align-items: flex-start; width: 360px; max-width: 100%; padding: .85rem .95rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--link); border-radius: 14px; box-shadow: var(--sh-3); animation: cj-toast-in .3s var(--ease); }
.toast.is-out { animation: cj-toast-out .25s ease forwards; }
@keyframes cj-toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes cj-toast-out { to { opacity: 0; transform: translateX(16px); } }
.toast--success { border-left-color: var(--success-solid); } .toast--success .toast__icon { color: var(--success); }
.toast--error { border-left-color: var(--danger-solid); } .toast--error .toast__icon { color: var(--danger); }
.toast--warning { border-left-color: var(--st-aberto-dot); } .toast--warning .toast__icon { color: var(--warning); }
.toast--info .toast__icon { color: var(--link); }
.toast__icon { margin-top: 1px; }
.toast__title { font-weight: 650; font-size: .875rem; line-height: 1.3; }
.toast__text { font-size: .8125rem; color: var(--text-2); margin-top: 2px; line-height: 1.4; }
.toast__x { margin-left: auto; color: var(--text-faint); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; flex: none; }
.toast__x:hover { background: var(--sunken); color: var(--text); }

/* ---------- Avisos (callouts) ---------- */
.callout { --c: var(--info); --cb: var(--info-bg); --cl: var(--info-line); display: flex; gap: .75rem; padding: .85rem 1rem; border-radius: 12px; background: var(--cb); border: 1px solid var(--cl); color: var(--text); font-size: .875rem; line-height: 1.5; }
.callout > .i { color: var(--c); margin-top: .1rem; }
.callout__title { font-weight: 650; color: var(--text); }
.callout p { color: var(--text-2); }
.callout--warning { --c: var(--warning); --cb: var(--warning-bg); --cl: var(--warning-line); }
.callout--danger { --c: var(--danger); --cb: var(--danger-bg); --cl: var(--danger-line); }
.callout--success { --c: var(--success); --cb: var(--success-bg); --cl: var(--success-line); }

/* ---------- Tabela ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.table { font-size: .875rem; }
.table th { position: sticky; top: 0; padding: .8rem 1rem; text-align: left; font-size: .6875rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text-2); }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; }
.table .cell-title { font-weight: 650; color: var(--text); }
.table .cell-sub { font-size: .75rem; color: var(--text-3); margin-top: 2px; }
.table .t-right { text-align: right; }

/* ---------- Estado vazio ---------- */
.empty { text-align: center; padding: clamp(2rem, 6vw, 4rem) 1.5rem; }
.empty__icon { width: 64px; height: 64px; margin: 0 auto 1.1rem; border-radius: 20px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-soft-text); }
.empty__icon .i { width: 28px; height: 28px; stroke-width: 1.5; }
.empty__title { font: 600 1.25rem/1.25 var(--font-serif); }
.empty__text { margin: .5rem auto 1.25rem; max-width: 42ch; color: var(--text-3); font-size: .9rem; }

/* ---------- Esqueleto, progresso ---------- */
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--sunken) 25%, var(--line) 37%, var(--sunken) 63%); background-size: 400% 100%; animation: cj-shimmer 1.4s ease infinite; }
@keyframes cj-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.progress { height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.progress > i { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 60%, var(--link))); transition: width .5s var(--ease); }
.progress--ok > i { background: var(--st-concluido-dot); }

/* ---------- Lista chave/valor ---------- */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
.kv__item { min-width: 0; }
.kv__item--wide { grid-column: 1 / -1; }
.kv__k { font-size: .6875rem; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.kv__v { margin-top: 3px; font-size: .9rem; color: var(--text); line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }

/* ---------- Arquivos ---------- */
.file { --fc: var(--text-3); --fb: var(--sunken); display: flex; align-items: center; gap: .65rem; min-width: 0; padding: .55rem .75rem .55rem .55rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; transition: border-color .15s, background .15s, box-shadow .15s; max-width: 100%; }
.file:hover { border-color: var(--line-strong); background: var(--surface-2); box-shadow: var(--sh-1); text-decoration: none; }
.file__icon { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--fb); color: var(--fc); }
.file__name { font-size: .8125rem; font-weight: 600; color: var(--text); min-width: 0; max-width: 220px; }
.file__meta { font-size: .6875rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
[data-ext='pdf'] { --fc: var(--n01-fg); --fb: var(--n01-bg); }
[data-ext='doc'], [data-ext='docx'], [data-ext='odt'], [data-ext='rtf'] { --fc: var(--n04-fg); --fb: var(--n04-bg); }
[data-ext='xls'], [data-ext='xlsx'], [data-ext='csv'], [data-ext='ods'] { --fc: var(--st-concluido-fg); --fb: var(--st-concluido-bg); }
[data-ext='png'], [data-ext='jpg'], [data-ext='jpeg'], [data-ext='gif'], [data-ext='webp'] { --fc: var(--st-assinatura-fg); --fb: var(--st-assinatura-bg); }
[data-ext='zip'], [data-ext='rar'], [data-ext='7z'] { --fc: var(--n03-fg); --fb: var(--n03-bg); }

.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; text-align: center; padding: 1.4rem 1rem; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface-2); color: var(--text-3); cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.dropzone:hover, .dropzone.is-drag { border-color: var(--link); background: var(--brand-soft); color: var(--brand-soft-text); }
.dropzone .i { width: 1.5rem; height: 1.5rem; }
.dropzone__title { font-weight: 650; font-size: .875rem; color: var(--text); }
.dropzone__sub { font-size: .75rem; }
.dropzone__list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: .4rem; }
.dropzone input[type='file'] { display: none; }

/* ---------- Dica (tooltip) ---------- */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; translate: -50% 4px; padding: .35rem .6rem; border-radius: 8px; background: #0d1b2e; color: #fff; font-size: .75rem; font-weight: 600; line-height: 1.2; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, translate .15s; z-index: 90; box-shadow: var(--sh-2); }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; translate: -50% 0; }
:root[data-theme='dark'] [data-tip]::after { background: #e8eef7; color: #0d1b2e; }
[data-tip][data-tip-pos='bottom']::after { bottom: auto; top: calc(100% + 8px); translate: -50% -4px; }
[data-tip][data-tip-pos='bottom']:hover::after { translate: -50% 0; }

/* ==========================================================================
   Peças do "casco" do app: sidebar, topo, notificações, perfil
   ========================================================================== */
.sidebar__top { display: flex; align-items: center; padding-right: 12px; }
.sidebar__top .brand { flex: 1; min-width: 0; }

.icon-btn--sm { width: 34px; height: 34px; border-radius: 9px; }
.theme-ic { display: grid; place-items: center; }
.theme-ic--sun { display: none; }
:root[data-theme='dark'] .theme-ic--sun { display: grid; }
:root[data-theme='dark'] .theme-ic--moon { display: none; }

.link-btn { color: var(--link); font-size: .8125rem; font-weight: 600; padding: 2px 4px; border-radius: 6px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: cj-spin .7s linear infinite; }
.btn--secondary.is-loading::after, .btn--ghost.is-loading::after { border-color: var(--line-strong); border-top-color: var(--text-2); }

.menu--notif { width: 380px; padding: 0; overflow: hidden; }
.menu__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.notif-list { max-height: min(60vh, 420px); overflow-y: auto; }
.notif { display: flex; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); color: var(--text); transition: background .12s; }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--link); margin-top: .45rem; flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 18%, transparent); }
.notif__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif__text { font-size: .875rem; line-height: 1.4; }
.notif__time { font-size: .75rem; color: var(--text-3); }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 2rem 1.5rem; text-align: center; color: var(--text-3); font-size: .8125rem; }
.notif-empty .i { color: var(--text-faint); margin-bottom: 6px; }
.notif-empty strong { color: var(--text); font-size: .9rem; }

.menu--profile { width: 280px; }
.profile-head { display: flex; align-items: center; gap: .85rem; padding: .85rem .75rem; }
.profile-head__meta { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.profile-head__name { font-weight: 650; font-size: .9375rem; line-height: 1.3; }
.profile-head__user { font-size: .8125rem; color: var(--text-3); }

.photo-pick { position: relative; display: inline-grid; border-radius: 50%; }
.photo-pick .avatar { font-size: 1.6rem; }
.photo-pick__over { position: absolute; inset: 0; border-radius: 50%; display: grid; place-content: center; justify-items: center; gap: 2px; background: rgba(8, 18, 34, .55); color: #fff; font-size: .75rem; font-weight: 600; opacity: 0; transition: opacity .15s; }
.photo-pick:hover .photo-pick__over, .photo-pick:focus-visible .photo-pick__over { opacity: 1; }

.fact { display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; color: var(--text-3); font-weight: 500; white-space: nowrap; }
.fact .i { color: var(--text-faint); }

.toggle { display: inline-flex; align-items: center; gap: .45rem; height: 34px; padding: 0 .85rem; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); font-size: .8125rem; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.toggle:hover { background: var(--surface-2); border-color: var(--text-faint); }
.toggle[aria-pressed='true'] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-soft-text); }
:root[data-theme='dark'] .toggle[aria-pressed='true'] { border-color: var(--link); }
.toggle__n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--sunken); color: var(--text-2); font-size: .6875rem; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.toggle[aria-pressed='true'] .toggle__n { background: var(--brand); color: #fff; }
.toggle--danger { color: var(--danger); }
.toggle--danger .toggle__n { background: var(--danger-bg); color: var(--danger); }

/* pessoas (painel de ciência) */
.oks-sum { padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin-bottom: 1rem; }
.oks-sum__top { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; font-size: .8125rem; color: var(--text-3); }
.oks-sum__top strong { font-size: 1.125rem; color: var(--text); }
.oks-h { margin: 1rem 0 .4rem; font-size: .6875rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.people { display: flex; flex-direction: column; }
.person { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person__meta { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.person__meta strong { font-size: .875rem; color: var(--text); }
.person__meta span { font-size: .75rem; color: var(--text-3); }
.person__state { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 650; padding: .2rem .6rem; border-radius: 99px; }
.person__state.is-ok { color: var(--st-concluido-fg); background: var(--st-concluido-bg); }
.person__state.is-wait { color: var(--st-aberto-fg); background: var(--st-aberto-bg); }
.people__none { padding: .75rem 0; font-size: .875rem; color: var(--text-3); }

.file--sm { padding: .3rem .6rem .3rem .35rem; border-radius: 9px; }
.file--sm .file__icon { width: 24px; height: 24px; border-radius: 7px; }
.file--sm .file__name { font-size: .75rem; max-width: 160px; }
.file__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.file__x { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); flex: none; }
.file__x:hover { background: var(--danger-bg); color: var(--danger); }
