/* =========================================================
   LocFácil · Análise Cadastral — camada visual sobre Bootstrap 5.3
   ========================================================= */

:root {
    --lf-bg: #f4f6f9;
    --lf-surface: #ffffff;
    --lf-border: #e2e7ee;
    --lf-border-strong: #cdd5df;
    --lf-text: #101828;
    --lf-muted: #556072;
    --lf-accent: #1f5ae0;
    --lf-accent-hover: #1848b8;
    --lf-accent-soft: #e9f0ff;
    --lf-sidebar: #0f1b2d;
    --lf-sidebar-text: #c3cddc;
    --lf-sidebar-muted: #8592a6;
    --lf-sidebar-hover: rgba(255, 255, 255, .06);
    --lf-sidebar-active: rgba(91, 140, 255, .16);

    --lf-success: #12693f;  --lf-success-bg: #e5f4ec;
    --lf-warning: #8a5300;  --lf-warning-bg: #fff3d6;
    --lf-orange: #ad430a;   --lf-orange-bg: #ffe9da;
    --lf-danger: #b42318;   --lf-danger-bg: #fdeceb;
    --lf-info: #1650c4;     --lf-info-bg: #e8f0ff;
    --lf-neutral: #475467;  --lf-neutral-bg: #eef1f5;

    --lf-radius: 12px;
    --lf-radius-sm: 8px;
    --lf-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --lf-sidebar-w: 248px;
    --lf-sidebar-w-min: 72px;

    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-body-color: var(--lf-text);
    --bs-body-bg: var(--lf-bg);
    --bs-primary: var(--lf-accent);
    --bs-primary-rgb: 31, 90, 224;
    --bs-link-color: var(--lf-accent);
    --bs-link-color-rgb: 31, 90, 224;
    --bs-link-hover-color: var(--lf-accent-hover);
    --bs-border-color: var(--lf-border);
    --bs-secondary-color: var(--lf-muted);
}

body { background: var(--lf-bg); color: var(--lf-text); }
.text-muted { color: var(--lf-muted) !important; }

/* Botões e foco */
.btn { border-radius: var(--lf-radius-sm); font-weight: 500; }
.btn-primary { --bs-btn-bg: var(--lf-accent); --bs-btn-border-color: var(--lf-accent); --bs-btn-hover-bg: var(--lf-accent-hover); --bs-btn-hover-border-color: var(--lf-accent-hover); --bs-btn-active-bg: var(--lf-accent-hover); --bs-btn-disabled-bg: var(--lf-accent); --bs-btn-disabled-border-color: var(--lf-accent); }
.btn-light { --bs-btn-bg: var(--lf-surface); --bs-btn-border-color: var(--lf-border-strong); --bs-btn-hover-bg: var(--lf-neutral-bg); }
.btn i + *, .btn i { margin-right: .15rem; }
:focus-visible { outline: 3px solid rgba(31, 90, 224, .45); outline-offset: 2px; }
.form-control, .form-select { border-radius: var(--lf-radius-sm); border-color: var(--lf-border-strong); }
.form-control:focus, .form-select:focus { border-color: var(--lf-accent); box-shadow: 0 0 0 .2rem rgba(31, 90, 224, .18); }
.form-label { font-weight: 500; font-size: .875rem; margin-bottom: .35rem; }
.obrigatorio { color: var(--lf-danger); }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; background: var(--lf-accent); color: #fff; padding: .5rem 1rem; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* ---------- Estrutura ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1030;
    width: var(--lf-sidebar-w);
    display: flex; flex-direction: column;
    background: var(--lf-sidebar); color: var(--lf-sidebar-text);
    transition: width .2s ease, transform .2s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.1rem 1rem; border-bottom: 1px solid rgba(255,255,255,.07); min-height: 68px; }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; background: var(--lf-accent); color: #fff; font-size: 1.15rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; overflow: hidden; }
.brand-text strong { color: #fff; font-size: 1rem; }
.brand-text small { color: var(--lf-sidebar-muted); font-size: .75rem; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem .6rem; }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.sidebar-nav li + li { margin-top: 2px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem .75rem; border-radius: var(--lf-radius-sm);
    color: var(--lf-sidebar-text); text-decoration: none; white-space: nowrap; font-weight: 500;
    position: relative;
}
.sidebar-nav a i { font-size: 1.1rem; width: 1.25rem; text-align: center; flex: 0 0 1.25rem; }
.sidebar-nav a:hover { background: var(--lf-sidebar-hover); color: #fff; }
.sidebar-nav a.active { background: var(--lf-sidebar-active); color: #fff; }
.sidebar-nav a.active::before { content: ""; position: absolute; left: -.6rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #5b8cff; }
.sidebar-heading { margin: 1.25rem .75rem .4rem; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--lf-sidebar-muted); white-space: nowrap; overflow: hidden; }

.sidebar-user { border-top: 1px solid rgba(255,255,255,.07); padding: .75rem .6rem; display: flex; flex-direction: column; gap: .25rem; }
.user-card { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: var(--lf-radius-sm); color: var(--lf-sidebar-text); text-decoration: none; overflow: hidden; }
.user-card:hover, .user-card.active { background: var(--lf-sidebar-hover); color: #fff; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #24344d; color: #fff; font-size: .8rem; font-weight: 600; }
.user-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-text strong { font-size: .85rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-text small { color: var(--lf-sidebar-muted); font-size: .75rem; }
.btn-sair { width: 100%; display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; border: 0; border-radius: var(--lf-radius-sm); background: transparent; color: var(--lf-sidebar-text); font-weight: 500; white-space: nowrap; }
.btn-sair i { font-size: 1.1rem; width: 1.25rem; flex: 0 0 1.25rem; }
.btn-sair:hover { background: var(--lf-sidebar-hover); color: #fff; }

.app-main { flex: 1; min-width: 0; margin-left: var(--lf-sidebar-w); display: flex; flex-direction: column; transition: margin-left .2s ease; }

.topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: .9rem 1.75rem; min-height: 68px;
    background: rgba(255, 255, 255, .92); backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--lf-border);
}
.btn-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--lf-radius-sm); border: 1px solid var(--lf-border); background: var(--lf-surface); color: var(--lf-text); font-size: 1.25rem; }
.btn-icon:hover { background: var(--lf-neutral-bg); }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.3rem; font-weight: 650; margin: 0; line-height: 1.25; }
.topbar-title p { margin: .1rem 0 0; color: var(--lf-muted); font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-back { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--lf-muted); text-decoration: none; margin-bottom: .1rem; }
.topbar-back:hover { color: var(--lf-accent); }
.topbar-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.content { padding: 1.5rem 1.75rem 2rem; flex: 1; outline: none; }
.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.75rem; color: var(--lf-muted); font-size: .8rem; border-top: 1px solid var(--lf-border); }

.banner-simulacao { display: flex; gap: .6rem; align-items: center; padding: .6rem 1.75rem; background: repeating-linear-gradient(-45deg, #fff3d6, #fff3d6 12px, #ffeab8 12px, #ffeab8 24px); color: #5c3800; font-size: .875rem; border-bottom: 1px solid #f3d38a; }

/* Sidebar recolhida (desktop) */
.sidebar-recolhida .sidebar { width: var(--lf-sidebar-w-min); }
.sidebar-recolhida .app-main { margin-left: var(--lf-sidebar-w-min); }
.sidebar-recolhida .sidebar .brand-text,
.sidebar-recolhida .sidebar-nav a span,
.sidebar-recolhida .sidebar-heading,
.sidebar-recolhida .user-text,
.sidebar-recolhida .btn-sair span { display: none; }
.sidebar-recolhida .sidebar-brand { justify-content: center; padding-inline: 0; }
.sidebar-recolhida .sidebar-nav a, .sidebar-recolhida .btn-sair, .sidebar-recolhida .user-card { justify-content: center; }
.sidebar-recolhida .sidebar-heading { display: block; height: 1px; margin: 1rem .5rem; background: rgba(255,255,255,.08); font-size: 0; }

.sidebar-backdrop { position: fixed; inset: 0; z-index: 1025; background: rgba(15, 27, 45, .45); }

/* Tablet e celular: menu fora da tela */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: var(--lf-sidebar-w) !important; }
    .menu-aberto .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .app-main, .sidebar-recolhida .app-main { margin-left: 0; }
    .sidebar-recolhida .sidebar .brand-text, .sidebar-recolhida .sidebar-nav a span, .sidebar-recolhida .user-text, .sidebar-recolhida .btn-sair span { display: revert; }
    .topbar { padding: .75rem 1rem; }
    .content { padding: 1rem 1rem 1.5rem; }
    .app-footer, .banner-simulacao { padding-inline: 1rem; }
}
@media (max-width: 575.98px) {
    .topbar-actions { width: 100%; }
    .topbar-actions .btn { flex: 1; }
    .topbar-title h1 { font-size: 1.15rem; }
}

/* ---------- Painéis ---------- */
.panel { background: var(--lf-surface); border: 1px solid var(--lf-border); border-radius: var(--lf-radius); box-shadow: var(--lf-shadow); margin-bottom: 1.5rem; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--lf-border); }
.panel-header h2 { font-size: 1rem; font-weight: 650; margin: 0; }
.panel-body { padding: 1.25rem; }
.panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .85rem 1.25rem; border-top: 1px solid var(--lf-border); }
.link-mais { font-size: .875rem; text-decoration: none; font-weight: 500; }

/* ---------- Indicadores ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .9rem; align-items: center; padding: 1.1rem 1.2rem; background: var(--lf-surface); border: 1px solid var(--lf-border); border-radius: var(--lf-radius); box-shadow: var(--lf-shadow); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.kpi:hover { border-color: var(--lf-border-strong); transform: translateY(-1px); color: inherit; }
.kpi-icon { grid-row: 1 / 3; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; font-size: 1.25rem; }
.kpi-label { color: var(--lf-muted); font-size: .825rem; }
.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.15; }

.tom-success { background: var(--lf-success-bg); color: var(--lf-success); }
.tom-warning { background: var(--lf-warning-bg); color: var(--lf-warning); }
.tom-orange  { background: var(--lf-orange-bg);  color: var(--lf-orange); }
.tom-danger  { background: var(--lf-danger-bg);  color: var(--lf-danger); }
.tom-info    { background: var(--lf-info-bg);    color: var(--lf-info); }
.tom-neutral { background: var(--lf-neutral-bg); color: var(--lf-neutral); }

/* ---------- Selos de status (ícone + texto) ---------- */
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.4; white-space: nowrap; border: 1px solid transparent; }
.chip i { font-size: .85rem; }
.chip-success { background: var(--lf-success-bg); color: var(--lf-success); border-color: #c5e6d3; }
.chip-warning { background: var(--lf-warning-bg); color: var(--lf-warning); border-color: #f5dc9e; }
.chip-orange  { background: var(--lf-orange-bg);  color: var(--lf-orange);  border-color: #f9cfb2; }
.chip-danger  { background: var(--lf-danger-bg);  color: var(--lf-danger);  border-color: #f6c9c5; }
.chip-info    { background: var(--lf-info-bg);    color: var(--lf-info);    border-color: #c8d9fb; }
.chip-neutral { background: var(--lf-neutral-bg); color: var(--lf-neutral); border-color: #dde2ea; }
.chip-stack { display: flex; flex-wrap: wrap; gap: .3rem; }

/* ---------- Tabelas ---------- */
.table-modern { --bs-table-bg: transparent; margin: 0; }
.table-modern thead th { background: #f8fafc; color: var(--lf-muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--lf-border); padding: .7rem 1rem; white-space: nowrap; }
.table-modern td { padding: .8rem 1rem; border-color: var(--lf-border); }
.table-modern tbody tr:hover { background: #fafbfd; }
.table-modern tbody tr:last-child td { border-bottom: 0; }
.cell-title { display: block; font-weight: 600; }
.cell-sub { display: block; color: var(--lf-muted); font-size: .8rem; }
.paginacao .page-link { border-radius: 6px !important; margin: 0 2px; color: var(--lf-text); }
.paginacao .active .page-link { background: var(--lf-accent); border-color: var(--lf-accent); color: #fff; }

/* Tabelas viram cartões no celular */
@media (max-width: 767.98px) {
    .table-modern thead { display: none; }
    .table-modern, .table-modern tbody, .table-modern tr, .table-modern td { display: block; width: 100%; }
    .table-modern tr { padding: .75rem 1rem; border-bottom: 1px solid var(--lf-border); }
    .table-modern td { padding: .2rem 0; border: 0; text-align: left !important; }
    .table-modern td:empty { display: none; }
}

/* ---------- Filtros ---------- */
.filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem 1rem; padding: 1.1rem 1.25rem; align-items: end; }
.filtro-busca { grid-column: span 2; }
.filtro-acoes { display: flex; gap: .5rem; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--lf-muted); pointer-events: none; }
.input-icon .form-control { padding-left: 2.3rem; }
@media (max-width: 575.98px) { .filtro-busca { grid-column: auto; } }

/* ---------- Estados vazios e notas ---------- */
.empty-state { text-align: center; padding: 2.75rem 1.5rem; color: var(--lf-muted); }
.empty-state > i { font-size: 2.25rem; display: block; margin-bottom: .5rem; color: #98a2b3; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--lf-text); }
.nota { display: flex; gap: .75rem; padding: .85rem 1rem; border-radius: var(--lf-radius-sm); background: var(--lf-neutral-bg); color: var(--lf-neutral); font-size: .875rem; margin-top: 1rem; }
.nota p { margin: 0; }
.nota > i { font-size: 1.1rem; line-height: 1.3; }
.nota-warning { background: var(--lf-warning-bg); color: #5c3800; }
.nota-danger { background: var(--lf-danger-bg); color: #7a1610; }
.alert { border-radius: var(--lf-radius-sm); display: flex; gap: .6rem; align-items: baseline; }

/* ---------- Distribuição de risco ---------- */
.dist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.dist-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; font-size: .85rem; color: var(--lf-muted); }
.dist-bar, .score-bar { height: 8px; border-radius: 99px; background: var(--lf-neutral-bg); overflow: hidden; }
.dist-bar span, .score-bar span { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .4s ease; }
.dist-bar .tom-success, .score-bar .tom-success { background: #2f9e64; }
.dist-bar .tom-warning, .score-bar .tom-warning { background: #e6a700; }
.dist-bar .tom-orange,  .score-bar .tom-orange  { background: #e8701f; }
.dist-bar .tom-danger,  .score-bar .tom-danger  { background: #d93a2f; }
.dist-bar .tom-neutral, .score-bar .tom-neutral { background: #98a2b3; }
.stat-pairs { display: grid; gap: .6rem; margin: 0; }
.stat-pairs div { display: flex; justify-content: space-between; align-items: center; }
.stat-pairs dd { margin: 0; font-weight: 700; font-size: 1.1rem; }

/* ---------- Formulário em etapas ---------- */
.stepper { margin-bottom: 1rem; }
.stepper ol { display: flex; gap: .5rem; list-style: none; margin: 0; padding: 0; overflow-x: auto; }
.stepper a { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .85rem .45rem .45rem; border-radius: 999px; background: var(--lf-surface); border: 1px solid var(--lf-border); color: var(--lf-muted); text-decoration: none; font-size: .85rem; font-weight: 500; white-space: nowrap; }
.stepper a span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--lf-neutral-bg); font-size: .75rem; font-weight: 700; }
.stepper a.atual { border-color: var(--lf-accent); color: var(--lf-accent); }
.stepper a.atual span { background: var(--lf-accent); color: #fff; }
.stepper a.completa span { background: var(--lf-success); color: #fff; }
.form-section { background: var(--lf-surface); border: 1px solid var(--lf-border); border-radius: var(--lf-radius); box-shadow: var(--lf-shadow); padding: 1.25rem; margin-bottom: 1rem; scroll-margin-top: 90px; }
.form-section legend + * { clear: left; }
.form-section legend { float: left; width: 100%; padding: 0; font-size: 1rem; font-weight: 650; display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--lf-accent-soft); color: var(--lf-accent); font-size: .85rem; font-weight: 700; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
@media (max-width: 575.98px) { .form-actions .btn { flex: 1; } }
.sticky-xl { position: sticky; top: 90px; }
@media (max-width: 1199.98px) { .sticky-xl { position: static; } }

.fonte-lista { list-style: none; margin: 0; padding: 0; }
.fonte-lista li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid var(--lf-border); font-size: .9rem; }
.fonte-lista li:last-child { border-bottom: 0; }
.panel-progresso { display: flex; gap: 1rem; align-items: center; padding: 1.1rem 1.25rem; }

.resultado-card { border: 1px solid var(--lf-border); border-radius: var(--lf-radius); padding: 1.25rem; margin-top: 1rem; background: var(--lf-surface); box-shadow: var(--lf-shadow); }
.resultado-card h3 { font-size: 1.05rem; font-weight: 650; display: flex; gap: .5rem; align-items: center; }
.resultado-card.sucesso { border-left: 4px solid var(--lf-success); }
.resultado-card.revisao { border-left: 4px solid #e6a700; }
.resultado-card.falha { border-left: 4px solid var(--lf-danger); }

/* ---------- Detalhes da análise ---------- */
.resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; padding: 1rem 1.25rem; margin-bottom: 1.5rem; background: var(--lf-surface); border: 1px solid var(--lf-border); border-radius: var(--lf-radius); box-shadow: var(--lf-shadow); }
.resumo-item { display: flex; flex-direction: column; gap: .35rem; align-items: flex-start; }
.resumo-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--lf-muted); font-weight: 600; }
.score-box { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.score-num { display: flex; flex-direction: column; min-width: 120px; }
.score-num strong { font-size: 3rem; font-weight: 750; line-height: 1; letter-spacing: -.02em; }
.score-num span { color: var(--lf-muted); font-size: .85rem; }
.score-info { flex: 1; min-width: 240px; }
.score-bar { height: 10px; margin: .5rem 0 1rem; }
.table-componentes caption { caption-side: top; color: var(--lf-muted); font-size: .8rem; padding-top: 0; }
.table-componentes th { font-weight: 500; }
.observacoes { margin: 0; padding-left: 1.1rem; }
.observacoes li { margin-bottom: .25rem; }

.fonte-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.fonte-card { border: 1px solid var(--lf-border); border-radius: var(--lf-radius-sm); padding: .9rem 1rem; }
.fonte-card header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.fonte-card h3 { font-size: .9rem; font-weight: 650; margin: 0; }
.fonte-motivo { color: var(--lf-muted); font-size: .85rem; margin: 0; }
.dl-grid { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: .35rem .75rem; margin: 0; font-size: .875rem; }
.dl-grid dt { color: var(--lf-muted); font-weight: 500; }
.dl-grid dd { margin: 0; }
.dl-grid-2 { grid-template-columns: 150px 1fr; }
@media (max-width: 575.98px) { .dl-grid-2 { grid-template-columns: 1fr; } .dl-grid-2 dt { margin-top: .4rem; } }

.decisao-opcoes { display: flex; gap: .5rem; flex-wrap: wrap; }
.decisao-opcoes .btn { flex: 1; min-width: 100px; }
.decisao-atual { padding: .85rem 1rem; border-radius: var(--lf-radius-sm); background: #f8fafc; border: 1px solid var(--lf-border); }
.lista-simples { list-style: none; padding: 0; margin: 0; }
.lista-simples li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--lf-border); font-size: .875rem; }
.lista-simples li:last-child { border-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--lf-border); }
.timeline li { position: relative; padding: 0 0 .85rem .5rem; display: flex; flex-direction: column; font-size: .85rem; }
.timeline li::before { content: ""; position: absolute; left: -1.38rem; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--lf-surface); border: 2px solid var(--lf-accent); }
.timeline strong { font-weight: 600; }
.timeline small { color: var(--lf-muted); }

.senha-inline { display: flex; gap: .5rem; margin-top: .5rem; justify-content: flex-end; }
.senha-inline .form-control { max-width: 240px; }
.log-detalhes code { font-size: .75rem; word-break: break-all; color: var(--lf-text); }
.log-detalhes summary { cursor: pointer; color: var(--lf-accent); }

/* ---------- Integrações ---------- */
.param-lista { display: grid; gap: .5rem; }
.param-linha { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: .5rem; }
.mapa-grid { display: grid; grid-template-columns: minmax(180px, 34%) 1fr; gap: .75rem 1rem; align-items: center; margin-top: 1rem; }
.ajuda-mapa summary { cursor: pointer; color: var(--lf-accent); font-size: .875rem; }
.ajuda-mapa ul { margin-top: .5rem; padding-left: 1.1rem; }
.caminhos { max-height: 360px; overflow: auto; border: 1px solid var(--lf-border); border-radius: var(--lf-radius-sm); margin-top: .5rem; }
@media (max-width: 575.98px) {
    .param-linha { grid-template-columns: 1fr auto; }
    .param-linha input:nth-child(2) { grid-column: 1; }
    .mapa-grid { grid-template-columns: 1fr; gap: .25rem; }
    .mapa-grid input { margin-bottom: .6rem; }
}

/* ---------- Documentos (IA) ---------- */
.doc-upload-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
.doc-upload { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: 1.1rem .75rem; border: 2px dashed var(--lf-border-strong); border-radius: var(--lf-radius); text-align: center; cursor: pointer; color: var(--lf-muted); transition: border-color .15s, background .15s; margin: 0; }
.doc-upload:hover, .doc-upload:focus-within { border-color: var(--lf-accent); background: var(--lf-accent-soft); color: var(--lf-text); }
.doc-upload i { font-size: 1.6rem; color: var(--lf-accent); }
.doc-upload strong { color: var(--lf-text); font-size: .9rem; }
.doc-upload span { font-size: .78rem; }
.doc-upload.enviando { pointer-events: none; opacity: .7; border-style: solid; }
.doc-lista { display: grid; gap: .75rem; margin-top: .75rem; }
.doc-card { border: 1px solid var(--lf-border); border-left-width: 4px; border-radius: var(--lf-radius-sm); padding: .85rem 1rem; }
.doc-card header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.doc-card h3 { font-size: .95rem; font-weight: 650; margin: 0; }
.doc-card footer { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.doc-ok { border-left-color: #2f9e64; }
.doc-atencao { border-left-color: #e6a700; }
.doc-grave { border-left-color: #d93a2f; background: #fffafa; }
.doc-pendente { border-left-color: #98a2b3; }
.doc-alerta { display: flex; gap: .5rem; align-items: baseline; font-size: .85rem; margin: 0 0 .35rem; padding: .35rem .6rem; border-radius: 6px; }
.doc-alerta-grave { background: var(--lf-danger-bg); color: #7a1610; }
.doc-alerta-atencao { background: var(--lf-warning-bg); color: #5c3800; }
.doc-cruzamento { padding: .75rem 1rem; border: 1px solid var(--lf-border); border-radius: var(--lf-radius-sm); margin-top: .5rem; }
.doc-cruzamento strong { display: block; font-size: .875rem; margin-bottom: .4rem; }
.form-control.do-documento, .form-select.do-documento { border-color: #6f9bff; background-color: #f2f6ff; }
.link-gerado { margin-top: .75rem; }

/* ---------- Página pública de aceite ---------- */
.pagina-aceite { background: var(--lf-bg); }
.aceite-wrap { min-height: 100vh; display: flex; justify-content: center; padding: 1.5rem 1rem; }
.aceite-card { width: 100%; max-width: 680px; background: var(--lf-surface); border: 1px solid var(--lf-border); border-radius: 16px; padding: 1.75rem 1.5rem; box-shadow: var(--lf-shadow); align-self: flex-start; }
.aceite-card h1 { font-size: 1.35rem; font-weight: 700; }
.aceite-card .brand-mark { font-weight: 700; font-size: .9rem; }
.termo { border: 1px solid var(--lf-border); border-radius: var(--lf-radius-sm); padding: 1rem 1.1rem; font-size: .92rem; background: #fbfcfe; }
.termo h2 { font-size: 1.05rem; font-weight: 650; }
.termo ol { padding-left: 1.2rem; }
.termo li { margin-bottom: .4rem; }
.aceite-ok { color: var(--lf-success); font-weight: 600; }
.aceite-acoes { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }

/* ---------- Diálogo de confirmação ---------- */
.dialogo { border: 0; border-radius: var(--lf-radius); padding: 1.5rem; width: min(420px, calc(100vw - 2rem)); box-shadow: 0 20px 50px rgba(16, 24, 40, .25); }
.dialogo::backdrop { background: rgba(15, 27, 45, .45); }
.dialogo-acoes { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }

/* ---------- Login ---------- */
.pagina-login { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, #1f3a6b 0%, transparent 60%), var(--lf-sidebar); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.login-card { width: 100%; max-width: 420px; background: var(--lf-surface); border-radius: 16px; padding: 2.25rem 2rem; box-shadow: 0 25px 60px rgba(0, 0, 0, .35); }
.login-brand { display: flex; gap: .75rem; align-items: center; margin-bottom: 1.75rem; }
.login-brand div { display: flex; flex-direction: column; line-height: 1.15; }
.login-brand strong { font-size: 1.1rem; }
.login-brand span { color: var(--lf-muted); font-size: .8rem; }
.login-card h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: .25rem; }
.login-rodape { margin: 1.5rem 0 0; text-align: center; color: var(--lf-muted); font-size: .78rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
