/* ================================================
   JurisNexus — CSS Principal
   Paleta da marca: ver docs/MARCA_E_SITE.md
   ================================================ */

/* ── Cards de tipo PF/PJ no modal de cadastro rápido ── */
.tipo-pessoa-card { border-color: #dee2e6 !important; color: #6b7280; transition: all .15s ease; }
.tipo-pessoa-card:hover { border-color: #93c5fd !important; color: #1e40af; background: #f0f9ff; }
.tipo-pessoa-card.ativo { border-color: #2563eb !important; color: #1e40af; background: #eff6ff; }

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --sidebar-bg: #1a1d23;
    --sidebar-hover: #2a2d35;
    --sidebar-active: #2563eb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --brand-bg: #1e3a8a;      /* fundo da marca (azul profundo) */
    --accent: #06b6d4;        /* ciano — diagonal do "N" e destaques */
    --ink: #0b1424;           /* tinta — títulos e seções escuras */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --border-radius-lg: 12px;
    --border-radius-md: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-main);
    font-size: 0.9rem;
    background-color: #f3f4f6;
    color: #1f2937;
}

/* ------------------------------------------------
   LAYOUT PRINCIPAL
   ------------------------------------------------ */
#wrapper {
    min-height: 100vh;
}

#page-content-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.3s ease;
}

/* ------------------------------------------------
   SIDEBAR
   ------------------------------------------------ */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, #1c1f27 0%, #15171d 100%);
    border-right: 1px solid rgba(255,255,255,0.05);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform 0.3s ease, width 0.25s ease;
    /* O sidebar não rola — apenas o .sidebar-nav interno rola verticalmente.
       Assim o footer fica sempre fixo na base. */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#page-content-wrapper {
    margin-left: var(--sidebar-width);
}

/* Sidebar mobile — overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
}

/* ------------------------------------------------
   SIDEBAR — Header / Logo
   ------------------------------------------------ */
.sidebar-header {
    min-height: 64px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    background: var(--brand-bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.sidebar-logo i {
    color: #fff;
}

.sidebar-logo img,
.sidebar-logo .brand-mark {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ------------------------------------------------
   SIDEBAR NAV — container
   ------------------------------------------------ */

/* Bootstrap .nav aplica flex-wrap: wrap por padrão. Com flex-direction: column
   e altura limitada (flex-grow-1), itens quebram para nova coluna em vez de
   rolar — gerando itens lado a lado.
   min-height: 0 é obrigatório: sem ele, um flex-item com flex-grow-1 não encolhe
   abaixo do seu conteúdo — o footer seria empurrado para fora do sidebar. */
#sidebar .sidebar-nav {
    flex-wrap: nowrap !important;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

#sidebar .sidebar-nav::-webkit-scrollbar { width: 4px; }
#sidebar .sidebar-nav::-webkit-scrollbar-track { background: transparent; }
#sidebar .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 4px;
}

/* Cada item e label ocupam a largura total da coluna */
#sidebar .nav-item,
#sidebar .nav-section-label {
    width: 100%;
    min-width: 0;
    flex-shrink: 0;
}

/* ------------------------------------------------
   SIDEBAR — Section labels (com divisor)
   ------------------------------------------------ */
#sidebar .nav-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 10px 6px;
}

.nav-section-text {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.32);
    white-space: nowrap;
}

#sidebar .nav-section-label::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}

/* ------------------------------------------------
   SIDEBAR NAV LINKS
   ------------------------------------------------ */
#sidebar .nav-link {
    position: relative;
    color: #9aa1ad;
    padding: 8px 12px;
    border-radius: 9px;
    margin: 1px 0;
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 0.865rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    min-height: 38px;
}

#sidebar .nav-link i {
    font-size: 1.02rem;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    transition: color 0.15s ease;
}

/* Span de texto: trunca com ellipsis se o texto for longo */
#sidebar .nav-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
}

#sidebar .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #f3f4f6;
}

#sidebar .nav-link:hover i {
    color: #e5e7eb;
}

#sidebar .nav-link:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.7);
    outline-offset: -2px;
}

#sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.95) 0%, rgba(37, 99, 235, 0.72) 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

#sidebar .nav-link.active i {
    color: #fff;
}

#sidebar .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #bfdbfe;
}

/* ------------------------------------------------
   SIDEBAR — Grupos com submenu (chevron)
   ------------------------------------------------ */
.nav-group-row {
    position: relative;
}

.nav-group-row .nav-link {
    padding-right: 44px;
}

.nav-group-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-group-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-group-toggle:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.7);
}

.nav-group-toggle i {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.nav-group-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* O grupo continua contextualizado quando uma página filha está ativa, sem
   competir visualmente com o único link que recebe aria-current="page". */
#sidebar .nav-group.is-current > .nav-group-row > .nav-link:not(.active) {
    color: #dbeafe;
}

#sidebar .nav-group.is-current > .nav-group-row > .nav-link:not(.active) i,
#sidebar .nav-group.is-current > .nav-group-row > .nav-group-toggle {
    color: #93c5fd;
}

/* ------------------------------------------------
   SIDEBAR — Submenu (linha-guia + marcador)
   ------------------------------------------------ */
#sidebar .nav-sub {
    list-style: none;
    margin: 2px 0 4px 22px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.09);
}

#sidebar .nav-sub-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 10px;
    border-radius: 7px;
    margin: 1px 0;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.8rem;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
    min-height: 32px;
}

#sidebar .nav-sub-link::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

#sidebar .nav-sub-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

#sidebar .nav-sub-link:hover {
    background-color: var(--sidebar-hover);
    color: rgba(255, 255, 255, 0.9);
}

#sidebar .nav-sub-link:hover::before {
    background: rgba(255, 255, 255, 0.6);
}

#sidebar .nav-sub-link.active {
    background: rgba(37, 99, 235, 0.18);
    color: #93c5fd;
    font-weight: 600;
}

#sidebar .nav-sub-link.active::before {
    background: #60a5fa;
    box-shadow: 0 0 6px rgba(96, 165, 250, 0.8);
}

/* ------------------------------------------------
   SIDEBAR — Disabled nav links
   ------------------------------------------------ */
#sidebar .nav-link-disabled {
    color: rgba(255, 255, 255, 0.25) !important;
    cursor: default;
    pointer-events: none;
}

#sidebar .nav-link-disabled i {
    color: rgba(255, 255, 255, 0.18) !important;
}

/* ------------------------------------------------
   SIDEBAR — Inline badges (soon / restricted)
   ------------------------------------------------ */
.sidebar-badge-soon {
    display: inline-block;
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(251, 191, 36, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 4px;
    padding: 1px 5px;
    vertical-align: middle;
    line-height: 1.5;
}

.sidebar-badge-restricted {
    display: inline-block;
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 4px;
    padding: 1px 5px;
    vertical-align: middle;
    line-height: 1.5;
}

/* ------------------------------------------------
   SIDEBAR — Footer / usuário
   ------------------------------------------------ */
.sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.18);
}

.avatar-sm {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.sidebar-avatar {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
}

.sidebar-user {
    padding: 6px 8px;
    border-radius: 9px;
    transition: background-color 0.15s ease;
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.sidebar-logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

/* ------------------------------------------------
   SIDEBAR — Collapsed (modo mini, desktop)
   ------------------------------------------------ */
body.sidebar-collapsed #sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed #page-content-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed #sidebar .sidebar-brand,
body.sidebar-collapsed #sidebar .nav-section-text,
body.sidebar-collapsed #sidebar .nav-link span,
body.sidebar-collapsed #sidebar .nav-group-toggle,
body.sidebar-collapsed #sidebar .nav-sub,
body.sidebar-collapsed #sidebar .sidebar-user-info {
    display: none !important;
}

body.sidebar-collapsed #sidebar .sidebar-header {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.sidebar-collapsed #sidebar .nav-section-label {
    padding: 10px 8px 4px;
}

body.sidebar-collapsed #sidebar .nav-link {
    justify-content: center;
    gap: 0;
    padding: 10px 0;
}

body.sidebar-collapsed #sidebar .nav-group-row .nav-link {
    padding-right: 0;
}

body.sidebar-collapsed #sidebar .nav-link.active::before {
    display: none;
}

body.sidebar-collapsed #sidebar .sidebar-footer-row {
    flex-direction: column;
    gap: 6px !important;
}

body.sidebar-collapsed #sidebar .sidebar-user {
    padding: 4px;
}

/* ------------------------------------------------
   NAVBAR SUPERIOR
   ------------------------------------------------ */
header.navbar {
    min-height: 58px;
    z-index: 100;
}

/* ------------------------------------------------
   CARDS E STAT CARDS
   ------------------------------------------------ */
.card {
    border-radius: var(--border-radius-lg) !important;
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}

/* ------------------------------------------------
   GRADIENTE NO LOGIN
   ------------------------------------------------ */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--brand-bg) 0%, var(--primary) 100%);
}

/* ------------------------------------------------
   PÁGINA DE LOGIN
   ------------------------------------------------ */
.login-page {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #ede9fe 100%);
}

/* ------------------------------------------------
   PÁGINAS LEGAIS / CARTÃO DE AUTENTICAÇÃO — responsivo
   ------------------------------------------------ */
/* Cartão centrado que nunca estoura no celular (cap em 480px no desktop,
   92vw no mobile) — usado na tela de aceite de termos. */
.auth-card {
    width: min(480px, 92vw);
}

/* Largura de leitura confortável para textos longos (Termos/Privacidade):
   limita a medida em telas grandes e ocupa 100% no mobile. */
.legal-wrap {
    width: 100%;
    max-width: 760px;
    margin-inline: auto;
}

/* Documento de consentimento: corpo um pouco maior que o padrão (0.9rem) do
   app, para leitura confortável de texto longo em qualquer tela. */
.legal-content {
    overflow-wrap: break-word;
    word-break: break-word;
    font-size: 1rem;
    color: #374151;
}

.legal-content p,
.legal-content li {
    line-height: 1.7;
}

.legal-content a {
    text-decoration: underline;
}

.legal-content h1 {
    font-size: 1.6rem;
}

.legal-content h2 {
    font-size: 1.2rem;
    margin-top: 1.75rem;
    color: #1f2937;
}

/* No celular, os botões de ação (abrir documentos) empilham para alvo de
   toque maior e sem aperto horizontal. */
@media (max-width: 575.98px) {
    .auth-actions {
        flex-direction: column;
    }
}

/* ------------------------------------------------
   EMPTY STATE
   ------------------------------------------------ */
.empty-state {
    padding: 2rem 1rem;
}

/* ------------------------------------------------
   BREADCRUMB
   ------------------------------------------------ */
.breadcrumb {
    font-size: 0.82rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
}

/* ------------------------------------------------
   BADGES CUSTOMIZADOS
   ------------------------------------------------ */
.badge {
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ------------------------------------------------
   BOTÕES
   ------------------------------------------------ */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius-md);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ------------------------------------------------
   MODAIS — conteúdo nunca estoura na horizontal
   ------------------------------------------------ */
/* overflow-wrap é herdado: cobre título, corpo e rodapé de todos os modais.
   Sequências longas sem espaço (nº CNJ, URLs, teor de publicação) quebram
   em vez de vazar para a direita. Elementos .text-truncate seguem truncando. */
.modal-content {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ------------------------------------------------
   RESPONSIVO — Mobile
   ------------------------------------------------ */
@media (max-width: 991.98px) {
    #sidebar {
        width: min(var(--sidebar-width), 88vw);
        transform: translateX(-100%);
    }

    body.sidebar-open #sidebar {
        transform: translateX(0);
        box-shadow: 12px 0 32px rgba(0, 0, 0, 0.35);
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    #sidebar .nav-link {
        min-height: 44px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    #sidebar .nav-sub-link {
        min-height: 40px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    #sidebar .nav-group-toggle {
        width: 40px;
        height: 40px;
        right: 1px;
    }

    .sidebar-close-btn {
        width: 40px;
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    #page-content-wrapper {
        margin-left: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    #sidebar,
    #page-content-wrapper,
    #sidebar .nav-link,
    #sidebar .nav-sub-link,
    #sidebar .nav-group-toggle i {
        transition-duration: 0.01ms !important;
    }
}

/* ------------------------------------------------
   BUSCA GLOBAL — Navbar
   ------------------------------------------------ */
.busca-global {
    max-width: 420px;
}

.busca-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.busca-search-icon {
    position: absolute;
    left: 10px;
    color: #9ca3af;
    font-size: .85rem;
    pointer-events: none;
    z-index: 1;
}

.busca-input {
    width: 100%;
    padding: 7px 34px 7px 32px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: .875rem;
    font-family: var(--font-main);
    background: #f9fafb;
    color: #1f2937;
    transition: border-color .18s, background .18s, box-shadow .18s;
    outline: none;
}

.busca-input::placeholder {
    color: #9ca3af;
    font-size: .825rem;
}

.busca-input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.busca-clear-btn {
    position: absolute;
    right: 7px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    font-size: .8rem;
    transition: color .15s;
}

.busca-clear-btn:hover {
    color: #4b5563;
}

/* ------------------------------------------------
   BUSCA — Dropdown de resultados
   ------------------------------------------------ */
.busca-dropdown-container {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1055;
    max-height: 460px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
    border: 1px solid #e5e7eb;
    background: #fff;
    display: none;
    /* scrollbar slim */
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.busca-dropdown-container::-webkit-scrollbar { width: 5px; }
.busca-dropdown-container::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.busca-grupo:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}

.busca-grupo-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px 6px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6b7280;
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 1;
}

.busca-grupo-count {
    margin-left: auto;
    background: #e5e7eb;
    color: #374151;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.busca-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    text-decoration: none !important;
    color: #1f2937;
    transition: background .12s;
    border-bottom: 1px solid #f9fafb;
    cursor: pointer;
}

.busca-item:last-child {
    border-bottom: none;
}

.busca-item:hover {
    background: #eff6ff;
    color: #1e40af;
}

.busca-item:hover .busca-item-titulo {
    color: #1e40af;
}

.busca-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

.busca-icon-pessoa  { background: #dbeafe; color: #1d4ed8; }
.busca-icon-processo { background: #d1fae5; color: #065f46; }
.busca-icon-servico  { background: #fef3c7; color: #92400e; }
.busca-icon-tarefa   { background: #ede9fe; color: #6d28d9; }

.busca-item-info {
    flex: 1;
    min-width: 0;
}

.busca-item-titulo {
    font-size: .855rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #111827;
    transition: color .12s;
}

.busca-item-sub {
    font-size: .75rem;
    color: #6b7280;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.busca-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .02em;
    flex-shrink: 0;
}

.busca-badge-pf     { background: #dcfce7; color: #166534; }
.busca-badge-pj     { background: #dbeafe; color: #1e40af; }
.busca-badge-status { background: #f3f4f6; color: #374151; }

/* Estado vazio */
.busca-vazio {
    padding: 28px 16px;
    text-align: center;
    color: #6b7280;
}

.busca-vazio i {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 8px;
    color: #d1d5db;
}

.busca-vazio p {
    margin: 0 0 4px;
    font-size: .875rem;
    color: #374151;
}

.busca-vazio span {
    font-size: .78rem;
    color: #9ca3af;
}

/* Mobile: encurta placeholder */
@media (max-width: 575.98px) {
    .busca-global { max-width: none; }
    .busca-input::placeholder { font-size: .78rem; content: "Buscar..."; }
}

@media (max-width: 767.98px) {
    .busca-input { font-size: .82rem; }
}

/* ------------------------------------------------
   UTILITÁRIOS
   ------------------------------------------------ */
.text-truncate-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cursor-pointer { cursor: pointer; }

.border-radius-lg { border-radius: var(--border-radius-lg) !important; }

/* ------------------------------------------------
   CEP — Destaque ao preencher automaticamente
   ------------------------------------------------ */
.campo-preenchido {
    background-color: #f0fdf4 !important;
    border-color: #22c55e !important;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ------------------------------------------------
   PROCESSOS — Cards de listagem
   ------------------------------------------------ */
.processo-card {
    transition: box-shadow 0.2s ease, transform 0.12s ease;
    cursor: pointer;
}

.processo-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.13) !important;
    transform: translateY(-1px);
}

/* ------------------------------------------------
   PROCESSOS — Container dinâmico (fetch parcial)
   ------------------------------------------------ */
.processos-cards-container {
    position: relative;
    min-height: 120px;
    transition: opacity 0.15s ease;
}

.processos-cards-container.processos-loading {
    opacity: 0.45;
    pointer-events: none;
}

/* ------------------------------------------------
   PESSOAS — Listagem
   ------------------------------------------------ */
.pessoa-card {
    position: relative;
    border: 1px solid #e8ebef !important;
    border-radius: 14px !important;
    transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
    cursor: pointer;
}

.pessoa-card:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12) !important;
    transform: translateY(-2px);
    border-color: #d4def0 !important;
}

/* Anel de foco quando o usuário navega por teclado (link interno) */
.pessoa-card:focus-within {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
}

/* Avatar com inicial */
.pessoa-avatar {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

/* Nome e subtítulo */
.pessoa-card-name {
    font-size: 0.94rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
    text-decoration: none;
}
.pessoa-card-name:hover {
    color: var(--primary);
}
/* Linha de tipo (PF / PJ) + subtítulo (profissão / nome fantasia) */
.pessoa-card-type {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 3px;
    font-size: 0.77rem;
    font-weight: 500;
    color: #64748b;
    min-width: 0;
}
.pessoa-card-type > i {
    font-size: 0.8rem;
    flex-shrink: 0;
}
.pessoa-type-extra {
    color: #94a3b8;
    font-weight: 400;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Divisor sutil entre seções */
.pessoa-divider {
    height: 1px;
    background: #f0f2f5;
    margin: 0.7rem 0;
}

/* Bloco de contato com coluna de ícones alinhada */
.pessoa-meta {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}
.pessoa-meta-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.82rem;
    color: #475569;
    min-width: 0;
}
.pessoa-meta-row > i {
    font-size: 0.9rem;
    color: #94a3b8;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}
.pessoa-meta-row .value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pessoas-cards-container {
    position: relative;
    min-height: 120px;
    transition: opacity 0.15s ease;
}

.pessoas-cards-container.pessoas-loading {
    opacity: 0.45;
    pointer-events: none;
}

.tipo-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* ------------------------------------------------
   UTILITÁRIOS — preenchem lacunas do Bootstrap
   ------------------------------------------------ */
.min-width-0 { min-width: 0 !important; }   /* permite text-truncate dentro de flex */
.min-w-0 { min-width: 0 !important; }       /* alias usado em vários templates */
.bg-purple-subtle { background-color: #ede9fe !important; }
.text-purple { color: #7c3aed !important; }

/* ------------------------------------------------
   FORMULÁRIOS — Seções
   ------------------------------------------------ */
.form-section {
    border-left: 3px solid var(--primary);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* ------------------------------------------------
   AVATAR PESSOA
   ------------------------------------------------ */
.avatar-pessoa {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.avatar-pessoa-lg {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    font-size: 1.6rem;
}

/* ------------------------------------------------
   TABS customizadas
   ------------------------------------------------ */
.nav-tabs-custom .nav-link {
    border: none;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.6rem 1rem;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}

.nav-tabs-custom .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

.nav-tabs-custom .nav-link:hover:not(.active) {
    color: #374151;
    border-bottom-color: #d1d5db;
}

/* ------------------------------------------------
   FINANCEIRO — Seções colapsáveis
   ------------------------------------------------ */
.fin-section-toggle {
    cursor: pointer;
    user-select: none;
}
.fin-section-toggle .fin-chevron {
    transition: transform .2s ease;
    flex-shrink: 0;
}
.fin-section-toggle.collapsed .fin-chevron {
    transform: rotate(-90deg);
}
.fin-section-toggle:hover {
    background-color: #f9fafb !important;
}

/* Parcelas do processo: em telas estreitas cada lançamento vira um cartão
   compacto, sem exigir rolagem horizontal para conferir mês, valor e status. */
@media (max-width: 767.98px) {
    .parcelas-table {
        min-width: 0;
    }
    .parcelas-table > thead {
        display: none;
    }
    .parcelas-table,
    .parcelas-table > tbody {
        display: block;
        width: 100%;
    }
    .parcelas-table > tbody > .parcela-row {
        display: grid;
        grid-template-columns: 2.8rem minmax(0, 1fr) auto;
        gap: .2rem .65rem;
        padding: .75rem;
        border-bottom: 1px solid #e5e7eb;
    }
    .parcelas-table > tbody > .parcela-row > td {
        display: block;
        padding: 0 !important;
        border: 0;
        min-width: 0;
    }
    .parcelas-table .parcela-col-num {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: center;
        font-size: .78rem !important;
    }
    .parcelas-table .parcela-col-desc {
        grid-column: 2;
        grid-row: 1;
    }
    .parcelas-table .parcela-col-desc .text-truncate {
        max-width: 100% !important;
    }
    .parcelas-table .parcela-col-venc {
        grid-column: 2;
        grid-row: 2;
        color: #6b7280;
    }
    .parcelas-table .parcela-col-valor {
        grid-column: 3;
        grid-row: 1;
        align-self: start;
    }
    .parcelas-table .parcela-col-status {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
    }
    .parcelas-table .parcela-col-pago,
    .parcelas-table .parcela-col-saldo {
        display: none !important;
    }
    .parcelas-table .parcela-col-acoes {
        grid-column: 1 / -1;
        grid-row: 3;
        padding-top: .55rem !important;
        margin-top: .35rem;
        border-top: 1px dashed #e5e7eb !important;
    }
    .parcelas-table .parcela-col-acoes .d-flex {
        justify-content: flex-end !important;
    }
    .parcelas-table > tbody > .parcela-pagamentos-row {
        display: block;
    }
    .parcelas-table > tbody > .parcela-pagamentos-row > td {
        display: block;
    }
}
/* Sub-rows de pagamento individuais */
.pgto-sub-table td {
    font-size: .68rem;
    padding: 4px 8px;
}

/* ------------------------------------------------
   AGENDA — Calendário visual
   ------------------------------------------------ */
@media (max-width: 991.98px) {
    .agenda-layout > .col-lg-8,
    .agenda-layout > .col-lg-4 { flex: 0 0 100%; max-width: 100%; }
}
.agenda-cal-cell { min-height: 72px; }
@media (min-width: 1200px) { .agenda-cal-cell { min-height: 90px; } }

/* ------------------------------------------------
   INTELIGÊNCIA DA AGENDA
   ------------------------------------------------ */

/* Cards de resumo */
.intel-card {
    transition: box-shadow 0.15s ease;
}
.intel-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1) !important;
}
.intel-card-icon {
    font-size: 1.4rem;
    line-height: 1;
}

/* Mapa de dias */
.intel-dias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}

.intel-dia-card {
    border-radius: 10px;
    padding: 10px 8px 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.intel-dia-clicavel {
    cursor: pointer;
}

.intel-dia-clicavel:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.intel-dia-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.intel-dia-nome {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.05em;
}

.intel-dia-data {
    font-size: 0.72rem;
    color: #374151;
    font-weight: 600;
}

.intel-dia-total {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: #111827;
}

.intel-dia-vazio {
    font-size: 1.2rem;
    line-height: 1;
    text-align: center;
    margin-top: auto;
    margin-bottom: auto;
}

.intel-dia-breakdown {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.intel-chip {
    font-size: 0.58rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

.intel-chip-prazo    { background: #fee2e2; color: #991b1b; }
.intel-chip-tarefa   { background: #dbeafe; color: #1e3a8a; }
.intel-chip-audiencia { background: #cffafe; color: #155e75; }

.intel-dia-carga {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: auto;
}

/* Dia de hoje */
.intel-dia-hoje {
    border-color: #2563eb !important;
    background: #eff6ff;
}

/* Fim de semana */
.intel-dia-fds {
    background: #fafafa;
    opacity: 0.8;
}

/* Cores de carga */
.intel-carga-secondary { color: #9ca3af; }
.intel-carga-success   { color: #16a34a; }
.intel-carga-warning   { color: #d97706; }
.intel-carga-orange    { color: #ea580c; }
.intel-carga-danger    { color: #dc2626; }

/* Badge de carga no ranking */
.intel-carga-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Dia livre / leve / moderado / alto / crítico */
.intel-dia-secondary .intel-dia-carga { color: #9ca3af; }
.intel-dia-success   { border-left: 3px solid #16a34a; }
.intel-dia-success   .intel-dia-total { color: #15803d; }
.intel-dia-warning   { border-left: 3px solid #d97706; }
.intel-dia-warning   .intel-dia-total { color: #b45309; }
.intel-dia-orange    { border-left: 3px solid #ea580c; }
.intel-dia-orange    .intel-dia-total { color: #c2410c; }
.intel-dia-danger    { border-left: 3px solid #dc2626; }
.intel-dia-danger    .intel-dia-total { color: #b91c1c; }

/* Legenda */
.intel-legenda {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsivo — mobile */
@media (max-width: 575.98px) {
    .intel-dias-grid {
        grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
        gap: 6px;
    }
    .intel-dia-card {
        min-height: 76px;
        padding: 8px 6px 6px;
    }
    .intel-dia-total {
        font-size: 1.2rem;
    }
}

/* ================================================
   GESTÃO DE PRAZOS — KANBAN
   ================================================ */

/* Mini-resumo no topo */
.kb-stat { display: flex; align-items: baseline; gap: 4px; }
.kb-stat__num { font-size: 1.15rem; font-weight: 700; color: #1f2937; line-height: 1; }
.kb-stat__lbl { font-size: 0.72rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.04em; }
.kb-stat--danger .kb-stat__num { color: #dc2626; }

/* Quadro: colunas lado a lado com rolagem horizontal controlada */
.kanban-board {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x proximity;
    min-height: 60vh;
}

.kanban-col {
    flex: 0 0 290px;
    max-width: 290px;
    background: #f1f3f6;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 230px);
    scroll-snap-align: start;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.kanban-col.is-over {
    background: #e4e9f2;
    box-shadow: inset 0 0 0 2px var(--kb-color, #6366f1);
}

.kanban-col__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 8px;
    font-weight: 600;
    font-size: 0.82rem;
    color: #374151;
    border-bottom: 2px solid var(--kb-color, #6366f1);
    margin: 4px 6px 0;
}
.kanban-col__dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--kb-color, #6366f1); flex-shrink: 0;
}
.kanban-col__title { flex: 1 1 auto; min-width: 0; }
.kanban-col__count {
    flex-shrink: 0;
    background: #fff;
    color: #4b5563;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 9px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
}

.kanban-col__count--danger {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.kanban-col__body {
    padding: 10px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.kanban-col__empty {
    text-align: center;
    color: #9ca3af;
    font-size: 0.78rem;
    padding: 24px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.kanban-col__empty i { font-size: 1.5rem; opacity: 0.5; }

/* Cards */
.kanban-card {
    background: #fff;
    border-radius: 9px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    cursor: grab;
    transition: box-shadow 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}
.kanban-card:hover { box-shadow: 0 4px 12px rgba(16, 24, 40, 0.12); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.is-dragging { opacity: 0.45; transform: scale(0.98); }
.kanban-card.is-saving { opacity: 0.6; pointer-events: none; }

/* Realce por criticidade (borda esquerda) */
.kanban-card--vencido   { border-left-color: #dc2626; }
.kanban-card--hoje      { border-left-color: #f59e0b; }
.kanban-card--breve     { border-left-color: #0ea5e9; }
.kanban-card--concluido { border-left-color: #16a34a; }
.kanban-card--normal    { border-left-color: #cbd5e1; }

.kb-badge { font-size: 0.62rem; font-weight: 600; padding: 0.2em 0.5em; }

.kanban-card__grip { color: #cbd5e1; font-size: 0.95rem; cursor: grab; }

.kanban-card__title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 6px;
}
.kanban-card__title:hover { color: #dc2626; text-decoration: underline; }

.kanban-card__meta { font-size: 0.72rem; color: #6b7280; margin-bottom: 6px; }

.kanban-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.72rem;
    color: #6b7280;
}
.kanban-card__resp { min-width: 0; flex: 1 1 auto; }
.kanban-card__date { flex-shrink: 0; }

.kanban-card__internal {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed #eef0f3;
    font-size: 0.68rem;
    color: #9ca3af;
}

.kanban-card__comments {
    color: #6366f1;
    font-weight: 600;
    white-space: nowrap;
}

/* Visão gerencial */
.kb-kpi {
    background: #f8fafc;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
}
.kb-kpi__num { font-size: 1.4rem; font-weight: 800; line-height: 1; color: #1f2937; }
.kb-kpi__lbl { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; margin-top: 4px; }
.kb-kpi--danger  .kb-kpi__num { color: #dc2626; }
.kb-kpi--warning .kb-kpi__num { color: #d97706; }
.kb-kpi--info    .kb-kpi__num { color: #0ea5e9; }

.kb-bar { background: #eef0f3; border-radius: 6px; overflow: hidden; }
.kb-dot {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

/* Tablet/celular — colunas mais estreitas */
@media (max-width: 575.98px) {
    .kanban-col { flex-basis: 84vw; max-width: 84vw; }
}

/* ── Comunica PJe / DJEN ─────────────────────────────────────────────────── */
#comunicaLista { align-items: stretch; }

/* Filtros com leitura de uma única barra, separada da grade. */
.cpje-filtros {
  padding: .9rem 1rem 1rem;
  border: 1px solid #e7eaf0;
  border-radius: .85rem;
  background: #fff;
  box-shadow: 0 .15rem .65rem rgba(31, 41, 55, .045);
}

/* Card e estados de seleção. */
.comunica-card {
  overflow: hidden;
  border: 1px solid #e2e6ec;
  border-radius: .85rem;
  background: #fff;
  box-shadow: 0 .25rem .85rem rgba(31, 41, 55, .065);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.comunica-card:hover {
  border-color: #cfd5de;
  transform: translateY(-2px);
  box-shadow: 0 .65rem 1.6rem rgba(31, 41, 55, .11);
}
.comunica-card-sel {
  border-color: #5bb888;
  background: #fbfefc;
  box-shadow: 0 0 0 3px rgba(25, 135, 84, .14), 0 .45rem 1rem rgba(31, 41, 55, .08);
}
.comunica-card-sel:hover {
  border-color: #3a9d6d;
  box-shadow: 0 0 0 3px rgba(25, 135, 84, .16), 0 .7rem 1.5rem rgba(31, 41, 55, .11);
}

/* Cabeçalho: situação e origem à esquerda, data à direita. */
.cpje-card-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 48px;
  padding: .7rem 1rem;
  border-bottom: 1px solid #edf0f4;
  background: #fafbfc;
}
.cpje-card-check {
  display: grid;
  flex: 0 0 1rem;
  width: 1rem;
  min-height: 1rem;
  padding-left: 0;
  place-items: center;
  margin: 0;
}
.cpje-card-check .form-check-input {
  position: static;
  float: none;
  width: 1rem;
  height: 1rem;
  margin: 0 !important;
}
.cpje-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .4rem;
  padding: .2rem .55rem;
  border: 1px solid #dfe4ea;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: .75rem;
  font-weight: 650;
  line-height: 1.2;
}
.cpje-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #adb5bd;
}
.comunica-card[data-situacao="nova"]      .cpje-dot { background: #3b6df6; box-shadow: 0 0 0 3px rgba(59,109,246,.12); }
.comunica-card[data-situacao="vinculada"] .cpje-dot { background: #0891b2; box-shadow: 0 0 0 3px rgba(8,145,178,.12); }
.comunica-card[data-situacao="importada"] .cpje-dot { background: #198754; box-shadow: 0 0 0 3px rgba(25,135,84,.12); }
.comunica-card[data-situacao="ignorada"]  .cpje-dot { background: #8b95a1; }
.comunica-card[data-situacao="erro"]      .cpje-dot { background: #dc3545; box-shadow: 0 0 0 3px rgba(220,53,69,.12); }
.cpje-header-meta {
  min-width: 0;
  color: #596273;
  font-size: .78rem;
}
.cpje-header-meta strong { color: #3f4754; font-weight: 700; }
.cpje-sep { padding: 0 .3rem; color: #b0b7c1; }
.cpje-date {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .35rem;
  margin-left: auto;
  color: #687384;
  font-size: .75rem;
  white-space: nowrap;
}

.cpje-card-content {
  gap: .8rem;
  padding: 1rem;
}
.cpje-eyebrow,
.cpje-detail-label,
.cpje-resumo-label {
  color: #7a8493;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .035em;
  line-height: 1.2;
  text-transform: uppercase;
}

/* Identidade do processo como âncora principal do card. */
.cpje-processo { min-width: 0; }
.cpje-processo-main {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  margin-top: .15rem;
}
.cpje-proc-numero {
  overflow: hidden;
  min-width: 0;
  color: #172033;
  font-size: 1.04rem;
  font-weight: 750;
  letter-spacing: -.015em;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comunica-copy-num { color: #172033; }
.comunica-copy-num:hover { color: #b92f3b; }
.comunica-copy-num .bi-copy {
  margin-left: .42rem;
  color: #98a1ad;
  font-size: .76rem;
  vertical-align: .05em;
}
.cpje-link-status {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .2rem .48rem;
  border: 1px solid;
  border-radius: 999px;
  font-size: .69rem;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}
.cpje-link-status--ok { border-color: #b9e1cc; background: #eef9f3; color: #157347; }
.cpje-link-status--ok:hover { background: #e1f4e9; color: #0f613b; }
.cpje-link-status--pendente { border-color: #f0d99b; background: #fff8e6; color: #7a5800; }

/* Prazo em bloco próprio, legível por varredura e por criticidade. */
.comunica-prazo-previsto {
  display: grid;
  grid-template-columns: auto minmax(5.9rem, auto) minmax(0, 1fr);
  align-items: center;
  gap: .45rem .7rem;
  padding: .7rem .8rem;
  border: 1px solid #e1e5ea;
  border-left: 4px solid #adb5bd;
  border-radius: .65rem;
  background: #f8f9fb;
}
.comunica-prazo-previsto--ok      { border-left-color: #94a0ad; background: #f8f9fb; }
.comunica-prazo-previsto--proximo { border-color: #ecd99b; border-left-color: #e7ad16; background: #fffaf0; }
.comunica-prazo-previsto--vencido { border-color: #ecc5ca; border-left-color: #dc3545; background: #fff6f7; }
.cpje-prazo-icon {
  display: inline-grid;
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: .55rem;
  background: rgba(108,117,125,.1);
  color: #4f5b69;
  font-size: 1rem;
}
.comunica-prazo-previsto--proximo .cpje-prazo-icon { background: rgba(231,173,22,.13); color: #8a6500; }
.comunica-prazo-previsto--vencido .cpje-prazo-icon { background: rgba(220,53,69,.1); color: #bd2f3d; }
.cpje-prazo-main { display: flex; flex-direction: column; min-width: 5.9rem; }
.cpje-prazo-fatal { color: #202938; font-size: 1rem; font-weight: 750; line-height: 1.25; }
.cpje-prazo-fatal.text-danger { color: #bd2f3d !important; }
.cpje-prazo-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .4rem;
  min-width: 0;
}
.cpje-prazo-tag {
  padding: .18rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.cpje-prazo-tag--dias    { background: #e7ebf0; color: #44505f; }
.cpje-prazo-tag--hoje    { background: #ffd75d; color: #5c4400; }
.cpje-prazo-tag--vencido { background: #ca3644; color: #fff; }
.cpje-prazo-est { color: #747e8d; font-size: .7rem; font-style: italic; white-space: nowrap; }
.cpje-prazo-detalhe {
  display: flex;
  grid-column: 2 / -1;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: .2rem;
  min-width: 0;
  color: #697484;
  font-size: .72rem;
  line-height: 1.35;
}
.cpje-prazo-detalhe span { white-space: nowrap; }
.cpje-prazo-detalhe span + span::before { content: "·"; padding-right: .2rem; color: #a1a9b4; }

/* Contexto em linhas consistentes, sem competir com processo e prazo. */
.cpje-contexto {
  display: grid;
  gap: .55rem;
  padding: .75rem .8rem;
  border: 1px solid #edf0f3;
  border-radius: .65rem;
  background: #fcfcfd;
}
.cpje-detail-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: .55rem;
  min-width: 0;
}
.cpje-detail-row > .bi { margin-top: .12rem; color: #7c8796; font-size: .83rem; }
.cpje-detail-row > div { display: grid; grid-template-columns: 5.7rem minmax(0, 1fr); gap: .55rem; min-width: 0; }
.cpje-detail-label { padding-top: .13rem; }
.cpje-detail-value {
  overflow: hidden;
  min-width: 0;
  color: #444f60;
  font-size: .78rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cpje-detail-value strong { color: #303a4a; font-weight: 650; }
.cpje-partes-divisor { padding: 0 .35rem; color: #99a2ae; font-size: .7rem; font-style: italic; }
.cpje-mais-partes {
  margin-left: .4rem;
  padding: .08rem .35rem;
  border-radius: 999px;
  background: #edf0f4;
  color: #626d7b;
  font-size: .68rem;
  white-space: nowrap;
}

/* Resumo visualmente separado do dado estruturado. */
.cpje-resumo {
  padding: .65rem .75rem;
  border-left: 3px solid #d6dbe2;
  border-radius: 0 .5rem .5rem 0;
  background: #f7f8fa;
}
.cpje-resumo-label { display: flex; align-items: center; gap: .35rem; margin-bottom: .3rem; }
.comunica-texto { color: #505b6c; font-size: .77rem; line-height: 1.45; }
.comunica-texto-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Rodapé fixo visualmente, separando ações do conteúdo informacional. */
.cpje-footer {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 58px;
  margin-top: auto;
  padding: .65rem 1rem;
  border-top: 1px solid #edf0f4;
  background: #fbfcfd;
}
.cpje-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 34px;
  padding-inline: .8rem;
  border-radius: .45rem;
  font-weight: 650;
}
.cpje-footer-actions { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.cpje-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 34px;
  padding: .3rem .55rem;
  border: 1px solid transparent;
  border-radius: .42rem;
  background: transparent;
  color: #536071;
  font-size: .76rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.cpje-btn-ghost:hover,
.cpje-btn-ghost:focus { border-color: #dfe3e9; background: #fff; color: #1f2937; }
.cpje-btn-ghost:focus-visible {
  outline: 2px solid #dc3545;
  outline-offset: 2px;
}
.cpje-btn-ghost .bi { font-size: .9rem; }
.cpje-inline-panel { padding: .9rem 1rem 1rem; border-top: 1px solid #e4e8ed; background: #fff; }

/* Conferência da intimação: documento e decisões permanecem lado a lado. */
.cpje-conferencia-dialog {
  width: min(96vw, 1560px);
  max-width: min(96vw, 1560px);
  transition: width .18s ease, max-width .18s ease;
}
.cpje-prazo-mode .cpje-conferencia-dialog {
  width: min(94vw, 1120px);
  max-width: min(94vw, 1120px);
}
.cpje-conferencia-dialog .modal-content {
  overflow: hidden;
  max-height: 92vh;
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 1.5rem 4rem rgba(17, 24, 39, .2);
}
.conf-modal-header {
  flex: 0 0 auto;
  min-height: 88px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e7eaf0;
  background: #fff;
}
.conf-modal-header .modal-title {
  color: #172033;
  font-size: 1.12rem;
  letter-spacing: -.015em;
}
.conf-modal-subtitle {
  overflow: hidden;
  max-width: min(78vw, 1100px);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conf-modal-body {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.conf-scope--modal,
.conf-modal-grid { min-height: 0; height: 100%; }
.conf-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(470px, .92fr);
  height: calc(92vh - 88px);
  max-height: 760px;
}
.conf-mobile-nav { display: none; }
.conf-document-pane {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: .8rem;
  padding: 1.15rem 1.25rem 1rem;
  border-right: 1px solid #e2e6ec;
  background: #f3f5f8;
}
.conf-document-toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.conf-step-kicker {
  display: block;
  margin-bottom: .18rem;
  color: #7b8492;
  font-size: .66rem;
  font-weight: 750;
  letter-spacing: .075em;
  line-height: 1.2;
  text-transform: uppercase;
}
.conf-document-title {
  margin: 0;
  color: #283244;
  font-size: .96rem;
  font-weight: 750;
}
.conf-copy-text {
  flex: 0 0 auto;
  min-width: 112px;
  border-color: #d5dae2;
  background: #fff;
  color: #4f5b6a;
  font-size: .75rem;
}
.conf-document-meta {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: .4rem .85rem;
  color: #687384;
  font-size: .72rem;
  line-height: 1.35;
}
.conf-document-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.conf-document-meta .bi { color: #8c96a4; }
.conf-document-reader {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1.35rem 1.45rem 2rem;
  border: 1px solid #dfe3e9;
  border-radius: .7rem;
  outline: 0;
  background: #fff;
  box-shadow: 0 .25rem .85rem rgba(31, 41, 55, .045);
  color: #283141;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .96rem;
  line-height: 1.78;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  scrollbar-color: #bdc4ce transparent;
  scrollbar-width: thin;
}
.conf-document-reader:focus-visible {
  border-color: #cf6a74;
  box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .12);
}
.conf-document-empty {
  display: grid;
  min-height: 100%;
  place-content: center;
  gap: .65rem;
  color: #7a8492;
  font-family: inherit;
  text-align: center;
}
.conf-document-empty .bi { font-size: 2rem; }
.conf-reader-hint {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .4rem;
  color: #7a8492;
  font-size: .69rem;
}
.conf-review-pane {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 1.15rem 1.2rem 0;
  background: #fbfcfd;
  scrollbar-color: #bdc4ce transparent;
  scrollbar-width: thin;
}
.conf-review-intro {
  margin-bottom: .85rem;
  padding: .1rem .15rem;
}
.conf-review-intro h6 { color: #283244; font-size: .95rem; font-weight: 750; }
.conf-review-intro p { color: #6f7988; font-size: .76rem; }
.conf-scope--modal .conf-review-section {
  margin-bottom: .75rem;
  padding: .85rem .9rem;
  border: 1px solid #e2e6ec;
  border-radius: .7rem;
  background: #fff;
  box-shadow: 0 .12rem .45rem rgba(31, 41, 55, .035);
}
.conf-scope--modal .conf-review-section > h6 { display: flex; align-items: center; margin-top: 0 !important; }
.conf-section-number {
  display: inline-grid;
  width: 1.35rem;
  height: 1.35rem;
  margin-right: .45rem;
  place-items: center;
  border-radius: 50%;
  background: #f8e7e9;
  color: #b92f3b;
  font-size: .65rem;
  font-weight: 800;
}
.conf-scope:not(.conf-scope--modal) .conf-section-number { display: none; }
.conf-scope--modal .conf-processo-box { margin-bottom: 0 !important; }
.conf-scope--modal .conf-processo-box .alert { border: 0; font-size: .76rem; }
.conf-scope--modal .conf-partes-tabela {
  width: 100%;
  table-layout: fixed;
  font-size: .76rem;
}
.conf-scope--modal .conf-partes-tabela th { min-width: 0 !important; }
.conf-scope--modal .conf-partes-tabela th:nth-child(1) { width: 28%; }
.conf-scope--modal .conf-partes-tabela th:nth-child(2) { width: 43%; }
.conf-scope--modal .conf-partes-tabela th:nth-child(3) { width: 29%; }
.conf-scope--modal .conf-partes-tabela td { min-width: 0; overflow-wrap: anywhere; }
.conf-scope--modal .conf-ident-wrap,
.conf-scope--modal .conf-ident-wrap .input-group,
.conf-scope--modal .conf-classif { min-width: 0; }
.conf-scope--modal .conf-partes-tabela > :not(caption) > * > * { padding: .45rem .35rem; }
.conf-scope--modal .conf-review-actions {
  position: sticky;
  z-index: 12;
  bottom: 0;
  margin-inline: -1.2rem;
  padding: .8rem 1.2rem !important;
  border-top-color: #dfe3e9 !important;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -.45rem 1rem rgba(31, 41, 55, .055);
  backdrop-filter: blur(8px);
}
.conf-scope--modal .conf-review-actions .conf-btn-prazo {
  min-height: 36px;
  padding-inline: .9rem;
  font-weight: 700;
}

/* Etapa final do prazo: blocos curtos e hierarquia visual consistente. */
.cpje-prazo-header {
  flex: 0 0 auto;
  padding: 1rem 1.2rem .9rem;
  border-bottom: 1px solid #e4e8ed;
  background: #fff;
}
.cpje-prazo-header > div { min-width: 0; }
.cpje-prazo-header .modal-title { color: #172033; font-size: 1.1rem; letter-spacing: -.015em; }
.cpje-prazo-body {
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.15rem;
  background: #f5f7f9;
  scrollbar-color: #bdc4ce transparent;
  scrollbar-width: thin;
}
.cpje-prazo-summary {
  margin-bottom: .8rem;
  padding: .85rem .9rem;
  border: 1px solid #cfe2f3;
  border-radius: .75rem;
  background: #f0f7fc;
  color: #304457;
}
.cpje-prazo-summary-heading {
  display: flex;
  align-items: center;
  gap: .42rem;
  margin-bottom: .45rem;
  color: #264b67;
  font-size: .78rem;
  font-weight: 750;
}
.cpje-prazo-summary-list {
  margin: 0 0 .7rem;
  padding-left: 1.1rem;
  font-size: .75rem;
}
.cpje-prazo-dates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}
.cpje-prazo-date {
  min-width: 0;
  padding: .55rem .65rem;
  border: 1px solid rgba(91, 142, 180, .2);
  border-radius: .55rem;
  background: rgba(255, 255, 255, .72);
}
.cpje-prazo-date span,
.cpje-prazo-date strong { display: block; }
.cpje-prazo-date span { color: #6a7785; font-size: .67rem; }
.cpje-prazo-date strong { margin-top: .08rem; color: #273747; font-size: .8rem; }
.cpje-prazo-date--fatal strong { color: #a72b37; }
.cpje-prazo-summary-note {
  margin-top: .55rem;
  color: #687786;
  font-size: .7rem;
  line-height: 1.4;
}
.cpje-prazo-processo-info {
  margin-bottom: .8rem;
  padding: .65rem .8rem;
  font-size: .74rem;
}
#formPrazoDJEN {
  display: grid;
  gap: .8rem;
}
#prazoDJENErro { margin: 0; padding: .65rem .8rem; }
.cpje-prazo-section {
  padding: .9rem;
  border: 1px solid #e1e5ea;
  border-radius: .75rem;
  background: #fff;
  box-shadow: 0 .12rem .45rem rgba(31, 41, 55, .035);
}
.cpje-prazo-section-title {
  display: flex;
  align-items: center;
  gap: .42rem;
  margin: 0 0 .7rem;
  color: #566171;
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.cpje-prazo-section-title .bi { color: #b92f3b; font-size: .85rem; }
.cpje-prazo-section .form-label {
  margin-bottom: .3rem;
  color: #394454;
  font-size: .75rem;
  font-weight: 650;
}
.cpje-prazo-section textarea { min-height: 8rem; resize: vertical; }
.cpje-prazo-footer {
  flex: 0 0 auto;
  gap: .5rem;
  padding: .75rem 1.15rem;
  border-top: 1px solid #dfe3e9;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 -.4rem 1rem rgba(31, 41, 55, .05);
  backdrop-filter: blur(8px);
}
.cpje-prazo-footer #btnSalvarPrazoDJEN { min-width: 126px; font-weight: 700; }

/* ── Revisão da importação em lote (modal #modalLoteConfirm) ─────────────── */
/* Cartões-resumo clicáveis: leem o lote de relance e filtram a tabela. */
.lote-resumo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: .5rem;
  margin-bottom: .65rem;
}
.lote-card {
  display: flex;
  flex-direction: column;
  gap: .05rem;
  padding: .5rem .7rem;
  border: 1px solid #e2e6ec;
  border-radius: .6rem;
  background: #fff;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.lote-card:hover { border-color: #c9d0da; box-shadow: 0 .15rem .5rem rgba(31, 41, 55, .07); }
.lote-card.ativo { border-color: #b92f3b; box-shadow: 0 0 0 2px rgba(185, 47, 59, .12); }
.lote-card-num { color: #202938; font-size: 1.15rem; font-weight: 750; line-height: 1.15; }
.lote-card-lbl {
  display: flex;
  align-items: center;
  gap: .28rem;
  color: #6b7480;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.lote-card-lbl .lote-sw { height: .7rem; }
.lote-card--perigo .lote-card-num { color: #bd2f3d; }
.lote-card--alerta .lote-card-num { color: #8a6500; }

/* Legenda da faixa lateral — os mesmos itens servem de filtro. */
.lote-legenda {
  margin-bottom: .65rem;
  padding: .55rem .7rem .5rem;
  border: 1px solid #e2e6ec;
  border-radius: .6rem;
  background: #fbfcfd;
}
.lote-legenda-titulo {
  margin-bottom: .4rem;
  color: #44505f;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.lote-legenda-sub {
  align-self: center;
  margin-right: .1rem;
  color: #7c8796;
  font-size: .7rem;
  font-weight: 600;
}
.lote-legenda-nota {
  margin-top: .35rem;
  color: #7c8796;
  font-size: .68rem;
  line-height: 1.35;
}

/* Chips de legenda/filtro. */
.lote-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.lote-chips--sec { margin-top: .35rem; padding-top: .35rem; border-top: 1px dashed #e2e6ec; }
.lote-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .55rem;
  border: 1px solid #dfe3e9;
  border-radius: 999px;
  background: #fff;
  color: #55606e;
  font-size: .74rem;
  font-weight: 600;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.lote-chip:hover:not(:disabled) { border-color: #c9d0da; background: #f6f8fa; }
.lote-chip.ativo { border-color: #b92f3b; background: #fdeef0; color: #a02734; }
.lote-chip:disabled { cursor: default; opacity: .5; }
.lote-chip-n {
  min-width: 1.15rem;
  padding: 0 .28rem;
  border-radius: 999px;
  background: #eef1f5;
  color: #55606e;
  font-size: .68rem;
  font-weight: 700;
  text-align: center;
}
.lote-chip.ativo .lote-chip-n { background: #f6ccd2; color: #a02734; }

/* Amostra da faixa lateral (mesma forma e cor que a linha exibe). */
.lote-sw {
  flex: 0 0 auto;
  width: .26rem;
  height: .95rem;
  border-radius: .13rem;
  background: #9aa2ad;
}
.lote-sw--vencido { background: #ca3644; }
.lote-sw--urgente { background: #e7ad16; }
.lote-sw--sem     { background: #9aa2ad; }
.lote-sw--ok      { border: 1px dashed #c2c9d2; background: transparent; }
.lote-sw--invalida {
  background: repeating-linear-gradient(45deg, #ca3644 0 2px, #ffe9eb 2px 4px);
}

/* Marcador dos filtros de origem (espelha a cor do selo da coluna Situação). */
.lote-dot { flex: 0 0 auto; width: .5rem; height: .5rem; border-radius: 50%; background: #9aa2ad; }
.lote-dot--alerta { background: #e7ad16; }
.lote-dot--perigo { background: #ca3644; }
.lote-dot--neutro { background: #9aa2ad; }

.lote-vencidos {
  margin-bottom: .6rem;
  padding: .5rem .7rem;
  border: 1px solid #ecd99b;
  border-radius: .55rem;
  background: #fffaf0;
}

/* Tabela: cabeçalho fixo, coluna de seleção fixa e zebra. */
.lote-tabela-wrap { position: relative; max-height: 52vh; overflow: auto; }
.lote-tabela { min-width: 67rem; }
.lote-tabela > thead > tr > th {
  position: sticky;
  z-index: 3;
  top: 0;
  border-bottom: 1px solid #dfe3e9;
  background: #f6f8fa;
  color: #55606e;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.lote-tabela > tbody > tr.lote-row--par > td { background-color: #fafbfc; }
.lote-tabela > tbody > tr > td { vertical-align: top; }
.lote-tabela .lote-col-sel {
  position: sticky;
  z-index: 2;
  left: 0;
  width: 2.5rem;
  background: inherit;
}
.lote-tabela > thead > tr > th.lote-col-sel { z-index: 4; background: #f6f8fa; }
.lote-tabela > tbody > tr > td.lote-col-sel { background-color: #fff; }
.lote-tabela > tbody > tr.lote-row--par > td.lote-col-sel { background-color: #fafbfc; }

.lote-th { padding: 0 !important; }
.lote-th-btn {
  display: block;
  width: 100%;
  padding: .45rem .25rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  white-space: nowrap;
}
.lote-th-btn:hover { color: #1f2937; }
.lote-th-btn:focus-visible { outline: 2px solid rgba(185, 47, 59, .45); outline-offset: -2px; }
.lote-th-btn.ativo { color: #a02734; }
.lote-ord-ic { font-size: .72rem; opacity: .55; }
.lote-th-btn.ativo .lote-ord-ic { opacity: 1; }

.lote-col-proc { min-width: 11rem; max-width: 13rem; }
.lote-col-titulo { min-width: 11rem; }
.lote-col-pub { width: 10.5rem; }
.lote-col-cont { width: 10.5rem; }
.lote-col-fatal { width: 10.5rem; }
.lote-col-sit { min-width: 7rem; }
.lote-col-resp { width: 9.5rem; }
.lote-partes { max-width: 12rem; }

/* Faixa do responsável padrão do lote: mesma linguagem visual do bloco de
   vencidos, em tom neutro por ser configuração e não alerta. */
.lote-responsavel {
  margin-bottom: .6rem;
  padding: .5rem .7rem;
  border: 1px solid #dfe4ea;
  border-radius: .55rem;
  background: #f8fafc;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.lote-responsavel select { width: auto; min-width: 11rem; }

.lote-contagem { display: flex; gap: .3rem; }
.lote-contagem .lote-row-dias { width: 4rem; flex: 0 0 4rem; }
.lote-contagem .lote-row-tipo { min-width: 0; }

.lote-hint {
  margin-top: .18rem;
  color: #7c8796;
  font-size: .68rem;
  line-height: 1.25;
  white-space: nowrap;
}
/* Nome do responsável atual do processo: corta com reticências em vez de
   vazar da célula (o título do elemento mostra o nome inteiro). */
.lote-col-resp .lote-hint { overflow: hidden; text-overflow: ellipsis; }
.lote-urgencia { margin-top: .2rem; }
.lote-tag {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  padding: .1rem .42rem;
  border-radius: .3rem;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
}
.lote-tag .bi { font-size: .72rem; }
.lote-tag--dias     { background: #e7ebf0; color: #44505f; }
.lote-tag--urgente  { background: #fff1cc; color: #7a5800; }
.lote-tag--hoje     { background: #ffd75d; color: #5c4400; }
.lote-tag--vencido  { background: #ca3644; color: #fff; }
.lote-tag--sem      { background: #e7ebf0; color: #8a929c; }
.lote-tag--invalida { background: #7a1d27; color: #fff; white-space: normal; }

/* Faixa lateral de urgência: repete, na borda da linha, o que o selo ao lado do
   prazo fatal diz por extenso — as cores estão documentadas na legenda do topo
   do modal (.lote-legenda), que usa exatamente as mesmas amostras. */
.lote-row > td:first-child { box-shadow: inset .18rem 0 0 0 transparent; }
.lote-row[data-urgencia="vencido"] > td:first-child { box-shadow: inset .18rem 0 0 0 #ca3644; }
.lote-row[data-urgencia="hoje"]    > td:first-child { box-shadow: inset .18rem 0 0 0 #e7ad16; }
.lote-row[data-urgencia="urgente"] > td:first-child { box-shadow: inset .18rem 0 0 0 #e7ad16; }
.lote-row[data-urgencia="sem-data"] > td:first-child { box-shadow: inset .18rem 0 0 0 #9aa2ad; }
.lote-row[data-urgencia="vencido"] > td { background-color: #fff6f7 !important; }
.lote-row--importada { opacity: .55; }
/* Em campos de data o ícone de validação do Bootstrap se sobrepõe ao seletor
   nativo — a borda vermelha já sinaliza o erro. */
.lote-tabela .form-control.is-invalid { padding-right: .5rem; background-image: none; }
/* Inconsistente usa faixa HACHURADA para não se confundir com "vencido". */
.lote-row[data-invalida="1"] > td:first-child {
  box-shadow: none;
  background-image: repeating-linear-gradient(45deg, #ca3644 0 2px, #ffe9eb 2px 4px);
  background-repeat: no-repeat;
  background-size: .18rem 100%;
  background-position: left top;
}
.lote-row[data-invalida="1"] > td { background-color: #fff6f7 !important; }

@media (max-width: 767.98px) {
  .cpje-filtros { padding: .75rem; }
  .cpje-card-header { flex-wrap: wrap; gap: .45rem .55rem; padding: .65rem .75rem; }
  .cpje-header-meta { order: 3; flex-basis: calc(100% - 1.65rem); margin-left: 1.65rem; }
  .cpje-date span { display: none; }
  .cpje-card-content { padding: .85rem .75rem; }
  .cpje-processo-main { flex-wrap: wrap; }
  .cpje-proc-numero { flex-basis: 100%; font-size: .96rem; }
  .comunica-prazo-previsto { grid-template-columns: auto minmax(0, 1fr); }
  .cpje-prazo-icon { grid-row: 1 / span 3; }
  .cpje-prazo-main,
  .cpje-prazo-status,
  .cpje-prazo-detalhe { grid-column: 2; }
  .cpje-prazo-status { justify-self: start; }
  .cpje-prazo-detalhe { white-space: normal; }
  .cpje-detail-row > div { grid-template-columns: 1fr; gap: .12rem; }
  .cpje-detail-value { white-space: normal; }
  .cpje-footer { align-items: stretch; flex-direction: column; gap: .45rem; padding: .65rem .75rem; }
  .cpje-btn-primary { justify-content: center; width: 100%; }
  .cpje-footer-actions { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin-left: 0; }
  .cpje-btn-ghost { justify-content: center; padding-inline: .35rem; }
  .lote-resumo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lote-tabela-wrap { max-height: 58vh; }
  .lote-card-num { font-size: 1rem; }
}

@media (max-width: 991.98px) {
  .cpje-conferencia-dialog,
  .cpje-conferencia-dialog .modal-content { width: 100%; max-width: none; max-height: none; border-radius: 0; }
  .conf-modal-header { min-height: 82px; padding: .85rem 1rem; }
  .conf-modal-subtitle { max-width: calc(100vw - 3.5rem); }
  .conf-modal-body { overflow-y: auto; }
  .conf-scope--modal,
  .conf-modal-grid { height: auto; max-height: none; }
  .conf-modal-grid { display: block; }
  .conf-mobile-nav {
    position: sticky;
    z-index: 20;
    top: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
    padding: .65rem 1rem;
    border-bottom: 1px solid #dfe3e9;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 .2rem .55rem rgba(31, 41, 55, .05);
    backdrop-filter: blur(8px);
  }
  .conf-mobile-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 38px;
    padding: .45rem .65rem;
    border: 1px solid #d9dee5;
    border-radius: .55rem;
    background: #f7f8fa;
    color: #647080;
    font-size: .76rem;
    font-weight: 700;
  }
  .conf-mobile-nav-btn.active {
    border-color: #cf5964;
    background: #fff0f1;
    color: #a52b36;
    box-shadow: 0 0 0 1px rgba(207, 89, 100, .08);
  }
  .conf-scope--modal .conf-document-pane,
  .conf-scope--modal .conf-review-pane { display: none; }
  .conf-scope--modal.conf-mobile-view--documento .conf-document-pane { display: flex; }
  .conf-scope--modal.conf-mobile-view--revisao .conf-review-pane { display: block; }
  .conf-document-pane { min-height: 58vh; padding: 1rem; border-right: 0; border-bottom: 0; }
  .conf-document-reader { min-height: 20rem; max-height: 48vh; padding: 1.1rem; font-size: .93rem; }
  .conf-review-pane { overflow: visible; padding: 1rem 1rem 0; }
  .conf-scope--modal .conf-review-actions { margin-inline: -1rem; padding-inline: 1rem !important; }
  .cpje-prazo-body { padding: .85rem; }
}

@media (max-width: 575.98px) {
  .conf-modal-header .modal-title { font-size: 1rem; }
  .conf-copy-text { min-width: 42px; }
  .conf-copy-text span { display: none; }
  .conf-document-toolbar { align-items: flex-end; }
  .conf-reader-hint { display: none; }
  .conf-document-pane { min-height: auto; }
  .conf-document-reader { min-height: 22rem; max-height: 56vh; line-height: 1.68; }
  .conf-scope--modal .conf-review-section { padding: .75rem; }
  .conf-scope--modal .conf-partes-tabela,
  .conf-scope--modal .conf-partes-tabela tbody,
  .conf-scope--modal .conf-partes-tabela tr,
  .conf-scope--modal .conf-partes-tabela td { display: block; width: 100%; }
  .conf-scope--modal .conf-partes-tabela thead { display: none; }
  .conf-scope--modal .conf-partes-tabela tr {
    margin-bottom: .65rem;
    padding: .65rem;
    border: 1px solid #e1e5ea;
    border-radius: .6rem;
    background: #fafbfc;
  }
  .conf-scope--modal .conf-partes-tabela tr:last-child { margin-bottom: 0; }
  .conf-scope--modal .conf-partes-tabela td {
    padding: 0 0 .6rem !important;
    border: 0;
  }
  .conf-scope--modal .conf-partes-tabela td:last-child { padding-bottom: 0 !important; }
  .conf-scope--modal .conf-partes-tabela td::before {
    display: block;
    margin-bottom: .25rem;
    color: #737e8c;
    content: attr(data-label);
    font-size: .62rem;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .conf-scope--modal .conf-review-actions { align-items: stretch !important; }
  .conf-scope--modal .conf-review-actions .conf-btn-prazo { flex: 1 0 100%; }
  .conf-scope--modal .conf-review-actions [data-bs-dismiss="modal"] { margin-left: auto !important; }
  .conf-mobile-nav { padding: .55rem .75rem; }
  .cpje-prazo-header { padding: .8rem .85rem; }
  .cpje-prazo-header .modal-title { font-size: 1rem; }
  .cpje-prazo-body { padding: .7rem; }
  .cpje-prazo-summary,
  .cpje-prazo-section { padding: .75rem; border-radius: .65rem; }
  .cpje-prazo-dates { grid-template-columns: 1fr; gap: .35rem; }
  .cpje-prazo-date {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem .55rem;
  }
  .cpje-prazo-date strong { flex: 0 0 auto; margin-top: 0; }
  .cpje-prazo-section textarea { min-height: 7rem; }
  .cpje-prazo-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
    padding: .65rem .7rem;
  }
  .cpje-prazo-footer .btn { min-width: 0; margin: 0 !important; }
  .cpje-prazo-footer #btnSalvarPrazoDJEN {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    min-height: 40px;
  }
  .cpje-prazo-footer [data-prazo-voltar],
  .cpje-prazo-footer .prazo-ver-integra-direto { grid-column: 1; width: 100%; }
  .cpje-prazo-footer [data-bs-dismiss="modal"] { grid-column: 2; width: 100%; }
}

/* ------------------------------------------------
   NOTIFICAÇÕES — Sino da navbar
   ------------------------------------------------ */
.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: #dc3545;
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
}

.notif-dropdown-menu {
    width: 360px;
    max-width: 92vw;
    padding: 0;
    overflow: hidden;
}

.notif-load-error .bi { font-size: 1.4rem; }

.notif-list {
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.notif-list::-webkit-scrollbar { width: 5px; }
.notif-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.notif-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 14px;
    text-decoration: none;
    color: #1f2937;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    transition: background .12s;
}

.notif-item:hover { background: #f9fafb; color: #1f2937; }
.notif-item-unread { background: #eff6ff; }
.notif-item-unread:hover { background: #e0eefe; }
.notif-item-disabled { cursor: default; opacity: .7; }

.notif-item-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #4f46e5;
    font-size: .9rem;
}

.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: .82rem; font-weight: 600; }
.notif-item-msg {
    font-size: .78rem;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-item-time { font-size: .68rem; color: #9ca3af; margin-top: 2px; }

.notif-item-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    margin-top: 4px;
}

@media (max-width: 575.98px) {
    .notif-dropdown-menu { width: 92vw; }
}

/* ================================================
   IMPORTAÇÃO — Histórico e drop zone
   ================================================ */
/* Histórico de importações: informação resumida em cards, sem tabela larga. */
.import-history-card {
  overflow: hidden;
  border: 1px solid #e5e9ef;
  border-radius: .9rem;
  box-shadow: 0 .2rem .75rem rgba(31, 41, 55, .055);
}
.import-history-body { padding: .75rem .9rem .55rem; }
.import-history-header {
  display: grid;
  grid-template-columns: 2.15rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
}
.import-history-icon {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border-radius: .65rem;
  background: #eef3fa;
  color: #365c89;
  font-size: 1.05rem;
}
.import-history-identity { min-width: 0; }
.import-history-filename {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 .2rem;
  color: #253247;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.import-history-summary {
  overflow: hidden;
  color: #748093;
  font-size: .73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-history-summary span { padding: 0 .15rem; color: #abb3bf; }
.import-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .75rem;
  color: #748093;
  font-size: .73rem;
}
.import-history-meta span { min-width: 0; overflow-wrap: anywhere; }
.import-history-meta .bi { margin-right: .28rem; }
.import-history-status { margin-top: .1rem; white-space: nowrap; }
.import-history-warning {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .35rem;
  color: #ae5a0a;
  font-size: .76rem;
}
.import-history-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
  margin-top: 0;
}
.import-history-stat {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: .35rem;
  padding: .48rem .55rem;
  border: 1px solid #edf0f4;
  border-radius: .5rem;
  background: #f8fafc;
}
.import-history-stat strong { color: #253247; font-size: .9rem; font-weight: 750; }
.import-history-stat span { color: #718096; font-size: .68rem; line-height: 1.2; }
.import-history-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .4rem;
  margin-top: auto;
  padding: .42rem .9rem;
  border-top: 1px solid #edf0f4;
  background: #fbfcfe;
}
@media (max-width: 575.98px) {
  .import-history-header { grid-template-columns: 2.15rem minmax(0, 1fr); }
  .import-history-status { grid-column: 2; justify-self: start; margin-top: -.1rem; }
  .import-history-stats { gap: .35rem; }
  .import-history-stat { display: block; padding: .4rem .45rem; }
  .import-history-stat span { display: block; }
}

.json-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: .75rem;
    padding: 2.25rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: #fff;
    outline: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.json-dropzone:hover,
.json-dropzone:focus-visible {
    border-color: var(--bs-primary, #0d6efd);
    background-color: rgba(13, 110, 253, .04);
}

.json-dropzone--active {
    border-color: var(--bs-primary, #0d6efd);
    background-color: rgba(13, 110, 253, .08);
}

.json-dropzone--error {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, .04);
}

.json-dropzone__idle i {
    font-size: 2.25rem;
    color: var(--bs-primary, #0d6efd);
    display: block;
    margin-bottom: .5rem;
}

.json-dropzone__file {
    font-weight: 600;
}

.json-dropzone__file i {
    font-size: 1.4rem;
    color: var(--bs-primary, #0d6efd);
}

.json-dropzone__tipo {
    font-weight: 600;
    font-size: .75rem;
}

.json-dropzone__tipo-resumo {
    font-weight: 400;
}

/* ── Conteúdo de documentos legais (Markdown renderizado) ───────────────── */
.legal-content h1 { font-size: 1.4rem; font-weight: 700; margin: 1rem 0 .6rem; }
.legal-content h2 { font-size: 1.15rem; font-weight: 700; margin: 1rem 0 .5rem; }
.legal-content h3 { font-size: 1rem; font-weight: 700; margin: .9rem 0 .4rem; }
.legal-content p { margin-bottom: .6rem; }
.legal-content ul, .legal-content ol { margin-bottom: .6rem; padding-left: 1.3rem; }
.legal-content { font-size: .92rem; line-height: 1.5; }

/* ── Gestão de Prazos — visão Lista ─────────────────────────────────────── */
.pz-table thead th {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    white-space: nowrap;
    border-bottom: 1px solid #eef0f3;
}
.pz-table tbody td {
    font-size: 0.83rem;
    vertical-align: middle;
    white-space: nowrap;
}

.pz-sort {
    color: #6b7280;
    text-decoration: none;
    white-space: nowrap;
}
.pz-sort:hover { color: #1f2937; }
.pz-sort.is-active { color: #dc2626; font-weight: 600; }

/* Realce por criticidade — borda esquerda da primeira célula (cores do Kanban) */
.pz-row td:first-child { border-left: 3px solid transparent; }
.pz-row--vencido   td:first-child { border-left-color: #dc2626; }
.pz-row--hoje      td:first-child { border-left-color: #f59e0b; }
.pz-row--breve     td:first-child { border-left-color: #0ea5e9; }
.pz-row--concluido td:first-child { border-left-color: #16a34a; }
.pz-row--normal    td:first-child { border-left-color: #e2e8f0; }
.pz-row--concluido .pz-titulo { opacity: 0.65; }
.pz-row:hover { background: #f8fafc; }

/* Saída animada da linha ao concluir um prazo pela lista */
.pz-row { transition: opacity 0.25s ease, transform 0.25s ease; }
.pz-row--removendo { opacity: 0; transform: translateX(14px); pointer-events: none; }

.pz-titulo-cell {
    max-width: 220px;
    overflow: hidden;
}

.pz-titulo {
    color: inherit;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pz-titulo:hover { color: #dc2626; text-decoration: underline; }
.pz-sub {
    margin-top: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
}

.pz-inline {
    max-width: 125px;
    border: 1px solid #e5e7eb;
    background: transparent;
}
.pz-inline:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}
.pz-inline-date { max-width: 110px; }
.pz-inline.is-saving { opacity: 0.55; pointer-events: none; }

.pz-actions .btn {
    padding: 0.15rem 0.4rem;
    line-height: 1;
}

/* Wrapper de scroll horizontal da tabela (equivalente ao .table-responsive do Bootstrap) */
.pz-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Barra de controles (ordenação + itens/página) acima da tabela */
.pz-toolbar { font-size: 0.83rem; }
.pz-ctrl { max-width: 210px; }
.pz-ctrl--perpage { max-width: 140px; }

/* Célula "Restam" — impede quebra de linha no badge */
.pz-dias { white-space: nowrap; }

/* Paginação — alinhamento vertical */
.pz-pagination { flex-wrap: nowrap; }

/* Larguras mínimas garantidas para colunas operacionais */
.pz-table .col-resp   { min-width: 118px; }
.pz-table .col-prio   { min-width: 100px; }
.pz-table .col-status { min-width: 118px; }

/* Responsivo: em telas estreitas a tabela rola dentro de .pz-scroll */
@media (max-width: 991.98px) {
    .pz-table { min-width: 680px; }
}
@media (max-width: 767.98px) {
    .pz-table { min-width: 600px; }
    .pz-ctrl, .pz-ctrl--perpage { max-width: 100%; }
}

/* ===========================================================================
   Modais roláveis cujo <form> envolve .modal-body + .modal-footer
   (29/08/2026). O Bootstrap só rola o .modal-body quando ele é filho DIRETO
   de .modal-content; com o <form> no meio, o conteúdo era cortado pelo
   overflow:hidden e o rodapé (botões Salvar/Cancelar) sumia da tela — visto
   no modal "Novo Honorário" do processo em qualquer altura de janela.
   =========================================================================== */
.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}
.modal-dialog-scrollable .modal-content > form > .modal-body {
    overflow-y: auto;
    min-height: 0;
}
.modal-dialog-scrollable .modal-content > form > .modal-header,
.modal-dialog-scrollable .modal-content > form > .modal-footer {
    flex-shrink: 0;
}

/* Valores do resumo financeiro do processo: nunca quebrar "R$ 36.000,00" no
   meio do número; em telas estreitas o número encolhe em vez de quebrar. */
.fin-resumo__valor {
    white-space: nowrap;
    font-size: clamp(.95rem, 1.6vw + .55rem, 1.25rem) !important;
}
