/* =====================================================================
   PROTEJA Saúde Ocupacional — Design System
   ===================================================================== */
:root {
    --pj-green: #006A4E;
    --pj-green-2: #078A69;
    --pj-green-deep: #01392B;
    --pj-green-soft: #E6F3EE;
    --pj-mint: #2FD3A0;
    --pj-white: #FFFFFF;
    --pj-bg: #F4F6F7;
    --pj-ink: #344054;
    --pj-ink-strong: #101828;
    --pj-muted: #667085;
    --pj-line: #E4E9EC;
    --pj-blue: #2E6BD8;
    --pj-amber: #E59A0B;
    --pj-red: #D64545;
    --pj-radius: 16px;
    --pj-radius-sm: 10px;
    --pj-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
    --pj-shadow-lg: 0 12px 40px rgba(1, 57, 43, .14);
    --sidebar-w: 268px;
    --sidebar-w-mini: 84px;
    --topbar-h: 72px;

    --bs-primary: var(--pj-green);
    --bs-primary-rgb: 0, 106, 78;
    --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-color: var(--pj-ink);
    --bs-body-bg: var(--pj-bg);
    --bs-border-color: var(--pj-line);
    --bs-link-color: var(--pj-green);
    --bs-link-hover-color: var(--pj-green-2);
    --bs-link-color-rgb: 0, 106, 78;
    --bs-link-hover-color-rgb: 7, 138, 105;
}

* { -webkit-font-smoothing: antialiased; }
body { font-size: .925rem; letter-spacing: -.005em; }
h1, h2, h3, h4, h5, h6, .h-title { color: var(--pj-ink-strong); font-weight: 700; letter-spacing: -.02em; }
a { text-decoration: none; }
.text-muted { color: var(--pj-muted) !important; }
.small-caps { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--pj-muted); }
.fw-semibold { font-weight: 600 !important; }

/* ---------- Botões ---------- */
.btn { border-radius: 10px; font-weight: 600; padding: .55rem 1rem; font-size: .875rem; display: inline-flex; align-items: center; gap: .45rem; justify-content: center; }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.3rem; font-size: 1rem; border-radius: 12px; }
.btn-primary { --bs-btn-bg: var(--pj-green); --bs-btn-border-color: var(--pj-green); --bs-btn-hover-bg: var(--pj-green-2); --bs-btn-hover-border-color: var(--pj-green-2); --bs-btn-active-bg: #005740; --bs-btn-active-border-color: #005740; --bs-btn-disabled-bg: var(--pj-green); --bs-btn-disabled-border-color: var(--pj-green); box-shadow: 0 4px 12px rgba(0, 106, 78, .22); }
.btn-outline-primary { --bs-btn-color: var(--pj-green); --bs-btn-border-color: #B7DACD; --bs-btn-hover-bg: var(--pj-green); --bs-btn-hover-border-color: var(--pj-green); --bs-btn-active-bg: var(--pj-green); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--pj-line); --bs-btn-color: var(--pj-ink); --bs-btn-hover-bg: #F7F9F9; --bs-btn-hover-border-color: #D5DDE0; }
.btn-soft { background: var(--pj-green-soft); color: var(--pj-green); border: 0; }
.btn-soft:hover { background: #D4EBE2; color: var(--pj-green); }
.btn-soft-danger { background: #FCEDED; color: var(--pj-red); border: 0; }
.btn-soft-danger:hover { background: #F8DADA; color: #B53636; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }

/* ---------- Formulários ---------- */
.form-label { font-weight: 600; font-size: .8rem; color: var(--pj-ink-strong); margin-bottom: .35rem; }
.form-control, .form-select { border-radius: 10px; border-color: #D9E0E3; padding: .6rem .85rem; font-size: .9rem; color: var(--pj-ink-strong); }
.form-select { padding-right: 2.5rem; background-position: right .85rem center; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.form-select[multiple], .form-select[size]:not([size='1']) { padding-right: .85rem; white-space: normal; }
.form-select-sm { padding: .3rem 2rem .3rem .6rem; background-position: right .6rem center; font-size: .82rem; }
.table .form-select-sm { min-width: 130px; }
.table .form-control-sm { min-width: 72px; padding-left: .5rem; padding-right: .5rem; }
.table td .cell-title { min-width: 150px; }
.form-control:focus, .form-select:focus { border-color: var(--pj-green-2); box-shadow: 0 0 0 4px rgba(7, 138, 105, .12); }
.form-control::placeholder { color: #98A2B3; }
.form-check-input:checked { background-color: var(--pj-green); border-color: var(--pj-green); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(7, 138, 105, .12); border-color: var(--pj-green-2); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }
.form-text { color: var(--pj-muted); font-size: .78rem; }
.input-group-text { border-radius: 10px; background: #F7F9F9; border-color: #D9E0E3; color: var(--pj-muted); }
.invalid-feedback { font-size: .78rem; }
.required::after { content: ' *'; color: var(--pj-red); }

/* ---------- Layout principal ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0; position: fixed; inset: 0 auto 0 0; z-index: 1040;
    background: radial-gradient(120% 60% at 0% 0%, rgba(47, 211, 160, .16) 0%, transparent 60%), linear-gradient(185deg, #013A2C 0%, #014B38 55%, #00563F 100%);
    color: rgba(255, 255, 255, .78); display: flex; flex-direction: column; transition: width .25s ease, transform .25s ease;
}
.sidebar::after { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18 14h4v4h4v4h-4v4h-4v-4h-4v-4h4z' fill='%23ffffff' fill-opacity='0.025'/%3E%3C/svg%3E"); }
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; gap: .75rem; padding: 0 1.4rem; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .07); flex-shrink: 0; }
.sidebar-brand .brand-plate { display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 12px; padding: 7px 14px; flex: 1; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.sidebar-brand .brand-logo { height: 42px; width: auto; display: block; }
.sidebar-brand .brand-simbolo { height: 32px; width: 32px; display: none; }
.sidebar-brand .brand-text { line-height: 1.1; white-space: nowrap; overflow: hidden; }
.sidebar-brand strong { display: block; font-size: 1.12rem; letter-spacing: .06em; font-weight: 800; }
.sidebar-brand small { font-size: .68rem; color: rgba(255, 255, 255, .6); letter-spacing: .04em; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 1rem .85rem; position: relative; z-index: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-section { font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: rgba(255, 255, 255, .42); padding: 1.1rem .8rem .45rem; white-space: nowrap; }
.nav-section:first-child { padding-top: .2rem; }
.sidebar .nav-link {
    display: flex; align-items: center; gap: .8rem; color: rgba(255, 255, 255, .76); border-radius: 11px; padding: .62rem .8rem;
    font-weight: 500; font-size: .875rem; position: relative; white-space: nowrap; transition: background .15s, color .15s;
}
.sidebar .nav-link i { font-size: 1.12rem; width: 1.25rem; text-align: center; flex-shrink: 0; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar .nav-link.active { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.sidebar .nav-link.active::before { content: ''; position: absolute; left: -.85rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--pj-mint); }
.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255, 255, 255, .07); position: relative; z-index: 1; }
.sidebar-card { background: rgba(255, 255, 255, .07); border-radius: 14px; padding: .9rem 1rem; font-size: .78rem; }
.sidebar-card .progress { height: 6px; background: rgba(255, 255, 255, .12); border-radius: 6px; }
.sidebar-card .progress-bar { background: var(--pj-mint); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; transition: margin .25s ease; display: flex; flex-direction: column; }
.topbar {
    height: var(--topbar-h); position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 1rem; padding: 0 1.75rem;
    background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--pj-line);
}
.topbar .page-title { font-size: 1.05rem; font-weight: 700; color: var(--pj-ink-strong); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .breadcrumb { font-size: .75rem; margin: 0; }
.topbar .breadcrumb a { color: var(--pj-muted); }
.content { padding: 1.75rem; flex: 1; }
.app-footer { padding: 1rem 1.75rem 1.5rem; color: var(--pj-muted); font-size: .76rem; }

.user-chip { display: flex; align-items: center; gap: .65rem; padding: .3rem .5rem .3rem .3rem; border-radius: 40px; border: 1px solid var(--pj-line); background: #fff; color: var(--pj-ink); }
.user-chip:hover { border-color: #CDD7DA; color: var(--pj-ink); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem; color: #fff; background: linear-gradient(135deg, var(--pj-green) 0%, var(--pj-green-2) 100%); flex-shrink: 0; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--pj-ink); border: 1px solid var(--pj-line); background: #fff; font-size: 1.1rem; }
.icon-btn:hover { color: var(--pj-green); border-color: #CDD7DA; }
.icon-btn .dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--pj-red); color: #fff; font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; padding: 0 3px; }
.dropdown-menu { border: 1px solid var(--pj-line); border-radius: 14px; box-shadow: var(--pj-shadow-lg); padding: .5rem; font-size: .875rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; display: flex; align-items: center; gap: .6rem; }
.dropdown-item:active { background: var(--pj-green); }
.notif-item { display: flex; gap: .7rem; padding: .65rem .75rem; border-radius: 10px; color: var(--pj-ink); }
.notif-item:hover { background: #F5F8F7; color: var(--pj-ink); }
.notif-item.unread { background: #F0F8F5; }

/* Sidebar recolhida (desktop) */
body.sidebar-mini .sidebar { width: var(--sidebar-w-mini); }
body.sidebar-mini .main { margin-left: var(--sidebar-w-mini); }
body.sidebar-mini .sidebar .brand-text, body.sidebar-mini .sidebar .nav-link span, body.sidebar-mini .nav-section, body.sidebar-mini .sidebar-card { display: none; }
body.sidebar-mini .nav-section + * { margin-top: .5rem; }
body.sidebar-mini .sidebar .nav-link { justify-content: center; padding: .7rem; }
body.sidebar-mini .sidebar-brand { justify-content: center; padding: 0; }
body.sidebar-mini .sidebar-brand .brand-plate { padding: 5px; border-radius: 10px; flex: 0 0 auto; }
body.sidebar-mini .sidebar-brand .brand-logo { display: none; }
body.sidebar-mini .sidebar-brand .brand-simbolo { display: block; }

.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; box-shadow: var(--pj-shadow-lg); }
    .main { margin-left: 0 !important; }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(1, 24, 18, .45); z-index: 1035; backdrop-filter: blur(2px); }
    body.sidebar-mini .sidebar .brand-text, body.sidebar-mini .sidebar .nav-link span, body.sidebar-mini .nav-section, body.sidebar-mini .sidebar-card { display: revert; }
    .topbar { padding: 0 1rem; }
    .content { padding: 1.1rem; }
}

/* ---------- Cards ---------- */
.card { border: 1px solid var(--pj-line); border-radius: var(--pj-radius); box-shadow: var(--pj-shadow); background: #fff; }
.card-header { background: transparent; border-bottom: 1px solid var(--pj-line); padding: 1.1rem 1.35rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card-header h2, .card-header h3, .card-title { font-size: 1rem; margin: 0; font-weight: 700; color: var(--pj-ink-strong); }
.card-body { padding: 1.35rem; }
.card-footer { background: #FAFBFB; border-top: 1px solid var(--pj-line); padding: 1rem 1.35rem; border-radius: 0 0 var(--pj-radius) var(--pj-radius); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.55rem; margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--pj-muted); }

.kpi { position: relative; overflow: hidden; padding: 1.25rem 1.35rem; height: 100%; }
.kpi .kpi-icon { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 1rem; }
.kpi .kpi-value { font-size: 1.85rem; font-weight: 800; color: var(--pj-ink-strong); letter-spacing: -.03em; line-height: 1; }
.kpi .kpi-label { color: var(--pj-muted); font-size: .82rem; margin-top: .35rem; font-weight: 500; }
.kpi::after { content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%; right: -40px; top: -40px; background: currentColor; opacity: .04; }
.tone-green { color: var(--pj-green); } .tone-green .kpi-icon { background: var(--pj-green-soft); color: var(--pj-green); }
.tone-blue { color: var(--pj-blue); } .tone-blue .kpi-icon { background: #EAF1FD; color: var(--pj-blue); }
.tone-amber { color: var(--pj-amber); } .tone-amber .kpi-icon { background: #FEF5E3; color: #C27F05; }
.tone-red { color: var(--pj-red); } .tone-red .kpi-icon { background: #FCEDED; color: var(--pj-red); }

.hero {
    border-radius: 20px; padding: 1.75rem 2rem; color: #fff; position: relative; overflow: hidden; border: 0;
    background: radial-gradient(70% 120% at 100% 0%, rgba(47, 211, 160, .35) 0%, transparent 60%), linear-gradient(120deg, #01392B 0%, #006A4E 60%, #078A69 100%);
    box-shadow: 0 10px 30px rgba(0, 106, 78, .25);
}
.hero h1 { color: #fff; font-size: 1.6rem; }
.hero p { color: rgba(255, 255, 255, .8); margin: 0; }
.hero .hero-shield { position: absolute; right: 1.5rem; bottom: -30px; width: 190px; opacity: .13; filter: brightness(0) invert(1); }
.hero .hero-meta { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.hero .hero-meta span { background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .14); border-radius: 30px; padding: .35rem .8rem; font-size: .78rem; display: inline-flex; gap: .4rem; align-items: center; }

/* ---------- Tabelas ---------- */
.table { --bs-table-hover-bg: #F7FAF9; margin: 0; font-size: .875rem; }
.table > :not(caption) > * > * { padding: .85rem 1rem; border-bottom-color: #EEF2F3; vertical-align: middle; }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--pj-muted); font-weight: 700; background: #FAFBFB; border-bottom: 1px solid var(--pj-line); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-card { overflow: hidden; }
.table-responsive { border-radius: 0 0 var(--pj-radius) var(--pj-radius); }
.cell-title { font-weight: 600; color: var(--pj-ink-strong); }
.cell-sub { font-size: .78rem; color: var(--pj-muted); }
.row-link { cursor: pointer; }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.filters .form-control, .filters .form-select { min-width: 160px; padding: .5rem .8rem; font-size: .85rem; }
.filters > .form-select, .filters > input.form-control:not([type=search]) { width: auto; flex: 0 1 auto; }
.filters .form-select { padding-right: 2.4rem; background-position: right .75rem center; }
.search-input { position: relative; }
.search-input i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--pj-muted); }
.search-input .form-control { padding-left: 2.3rem; min-width: 260px; }

/* ---------- Badges ---------- */
.badge-soft { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; border-radius: 30px; font-size: .72rem; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.badge-soft::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-soft.no-dot::before { display: none; }
.bs-green { background: #E3F4EC; color: #04764F; }
.bs-gray { background: #EEF1F3; color: #55606E; }
.bs-red { background: #FCEAEA; color: #C03535; }
.bs-amber { background: #FEF3DC; color: #A86A00; }
.bs-blue { background: #E8F0FD; color: #2459B8; }
.bs-teal { background: #DFF6F0; color: #0B7F68; }

/* ---------- Abas ---------- */
.nav-tabs-pj { border-bottom: 1px solid var(--pj-line); gap: .25rem; padding: 0 1.35rem; }
.nav-tabs-pj .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--pj-muted); font-weight: 600; padding: 1rem .9rem .85rem; font-size: .875rem; border-radius: 0; display: inline-flex; gap: .45rem; align-items: center; }
.nav-tabs-pj .nav-link:hover { color: var(--pj-ink-strong); }
.nav-tabs-pj .nav-link.active { color: var(--pj-green); border-bottom-color: var(--pj-green); background: transparent; }

/* ---------- Listas / detalhes ---------- */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.1rem 1.5rem; }
.dl-grid dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--pj-muted); font-weight: 700; margin-bottom: .2rem; }
.dl-grid dd { margin: 0; color: var(--pj-ink-strong); font-weight: 500; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: #EAEFF0; }
.timeline li { position: relative; padding: 0 0 1.05rem 2.6rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .tl-dot { position: absolute; left: 4px; top: 0; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid #D5E5DE; display: flex; align-items: center; justify-content: center; font-size: .7rem; color: var(--pj-green); }
.timeline .tl-title { font-weight: 600; color: var(--pj-ink-strong); font-size: .85rem; }
.timeline .tl-meta { color: var(--pj-muted); font-size: .76rem; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--pj-muted); }
.empty-state .es-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--pj-green-soft); color: var(--pj-green); display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1rem; }

.step-list { list-style: none; padding: 0; margin: 0; }
.step-list li { display: flex; align-items: center; gap: .8rem; padding: .55rem 0; font-size: .84rem; border-bottom: 1px dashed #EAEFF0; }
.step-list li:last-child { border-bottom: 0; }
.step-num { width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; background: #F1F4F5; color: var(--pj-muted); }
.step-list .concluida .step-num { background: var(--pj-green); color: #fff; }
.step-list .proxima .step-num { background: #FEF3DC; color: #A86A00; }

.perm-group { border: 1px solid var(--pj-line); border-radius: 14px; overflow: hidden; margin-bottom: 1rem; }
.perm-group-head { background: #FAFBFB; padding: .75rem 1rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--pj-line); }
.perm-row { display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid #F0F3F4; flex-wrap: wrap; }
.perm-row:last-child { border-bottom: 0; }
.perm-row .perm-mod { width: 160px; font-weight: 600; color: var(--pj-ink-strong); font-size: .85rem; }
.perm-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .7rem; border: 1px solid #DCE3E6; border-radius: 30px; font-size: .78rem; cursor: pointer; user-select: none; background: #fff; }
.perm-chip input { margin: 0; }
.perm-chip:has(input:checked) { background: var(--pj-green-soft); border-color: #A8D5C4; color: var(--pj-green); font-weight: 600; }
.perm-chip:has(input:disabled) { cursor: not-allowed; opacity: .75; }

.unit-card { border: 1px solid var(--pj-line); border-radius: 14px; padding: 1rem; display: flex; gap: .85rem; align-items: flex-start; background: #fff; height: 100%; transition: border-color .15s, transform .15s; color: var(--pj-ink); }
.unit-card:hover { border-color: #B9D9CC; transform: translateY(-1px); color: var(--pj-ink); }
.unit-card .unit-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--pj-green-soft); color: var(--pj-green); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.check-card { display: block; border: 1px solid #DCE3E6; border-radius: 12px; padding: .75rem .9rem; cursor: pointer; height: 100%; }
.check-card:has(input:checked) { border-color: var(--pj-green-2); background: #F2FAF7; box-shadow: 0 0 0 3px rgba(7, 138, 105, .08); }

.secret-box { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; background: #F4F7F6; border: 1px dashed #B9D2C8; border-radius: 10px; padding: .7rem 1rem; font-size: .95rem; letter-spacing: .08em; word-break: break-all; color: var(--pj-ink-strong); }
.qr-frame { background: #fff; border: 1px solid var(--pj-line); border-radius: 16px; padding: .75rem; display: inline-block; }
.qr-frame img { width: 190px; height: 190px; display: block; }
.code-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-weight: 700; font-family: ui-monospace, Menlo, monospace; padding: .7rem; }

.alert { border-radius: 12px; border: 0; font-size: .875rem; display: flex; gap: .7rem; align-items: flex-start; }
.alert i { font-size: 1.1rem; line-height: 1.2; }
.alert-success { background: #E3F4EC; color: #05603F; }
.alert-danger { background: #FCEAEA; color: #A12C2C; }
.alert-warning { background: #FEF3DC; color: #8A5800; }
.alert-info { background: #E8F0FD; color: #1E4F9F; }
.toast-stack { position: fixed; top: 86px; right: 1.5rem; z-index: 1090; width: min(420px, calc(100vw - 2rem)); display: flex; flex-direction: column; gap: .6rem; }
.toast-stack .alert { box-shadow: var(--pj-shadow-lg); animation: slideIn .3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.pagination { --bs-pagination-color: var(--pj-ink); --bs-pagination-active-bg: var(--pj-green); --bs-pagination-active-border-color: var(--pj-green); --bs-pagination-border-radius: 8px; --bs-pagination-font-size: .82rem; gap: .25rem; margin: 0; }
.pagination .page-link { border-radius: 8px !important; border-color: var(--pj-line); }

.diff-table td { font-size: .82rem; vertical-align: top; }
.diff-old { background: #FFF3F3; color: #9B2C2C; }
.diff-new { background: #EFFAF5; color: #05603F; }
pre.json { background: #0F1F1A; color: #CFE9DF; border-radius: 12px; padding: 1rem; font-size: .78rem; max-height: 340px; overflow: auto; }
.hash { font-family: ui-monospace, Menlo, monospace; font-size: .75rem; word-break: break-all; color: var(--pj-muted); }

/* ---------- Autenticação ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-brand {
    position: relative; overflow: hidden; color: #fff; padding: 3rem 3.5rem; display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(60% 50% at 85% 10%, rgba(47, 211, 160, .38) 0%, transparent 70%), radial-gradient(50% 60% at 0% 100%, rgba(7, 138, 105, .5) 0%, transparent 70%), linear-gradient(160deg, #012A20 0%, #01402F 45%, #006A4E 100%);
}
.auth-brand::before { content: ''; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg width='56' height='56' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M25 19h6v6h6v6h-6v6h-6v-6h-6v-6h6z' fill='%23ffffff' fill-opacity='0.035'/%3E%3C/svg%3E"); }
.auth-brand > * { position: relative; }
.auth-brand .brand-big { display: inline-flex; align-self: flex-start; align-items: center; background: #fff; border-radius: 18px; padding: 14px 22px; box-shadow: 0 12px 30px rgba(0, 0, 0, .22); }
.auth-brand .brand-big img { height: 64px; width: auto; display: block; }
.auth-brand .brand-big strong { font-size: 1.6rem; letter-spacing: .08em; font-weight: 800; display: block; line-height: 1; }
.auth-brand .brand-big small { color: rgba(255, 255, 255, .7); letter-spacing: .05em; }
.auth-brand h2 { color: #fff; font-size: 2.3rem; line-height: 1.15; max-width: 520px; font-weight: 800; }
.auth-brand h2 span { color: var(--pj-mint); }
.auth-brand .lead { color: rgba(255, 255, 255, .75); max-width: 470px; font-size: 1rem; }
.auth-features { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; max-width: 520px; margin-top: 1.75rem; }
.auth-features div { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; padding: .85rem 1rem; font-size: .82rem; display: flex; gap: .6rem; align-items: center; backdrop-filter: blur(4px); }
.auth-features i { color: var(--pj-mint); font-size: 1.15rem; }
.auth-units { font-size: .78rem; color: rgba(255, 255, 255, .6); display: flex; gap: 1.25rem; flex-wrap: wrap; }
.auth-units i { color: var(--pj-mint); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; background: #fff; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { font-size: 1.7rem; margin-bottom: .35rem; }
.auth-box .sub { color: var(--pj-muted); margin-bottom: 1.75rem; }
.auth-box .form-control { padding: .78rem 1rem; }
.auth-mobile-brand { display: none; }
.auth-wide .auth-box { max-width: 760px; }
@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-mobile-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 2rem; }
    .auth-mobile-brand img { height: 52px; width: auto; }
    .auth-mobile-brand strong { font-size: 1.2rem; letter-spacing: .08em; color: var(--pj-green); }
}
.pw-toggle { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--pj-muted); padding: .25rem .5rem; }
.pw-wrap { position: relative; }
.pw-meter { height: 4px; border-radius: 4px; background: #EEF1F3; margin-top: .45rem; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* ---------- Página de erro ---------- */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--pj-bg); }
.error-card { max-width: 520px; text-align: center; }
.error-code { font-size: 5rem; font-weight: 800; letter-spacing: -.05em; background: linear-gradient(135deg, var(--pj-green), var(--pj-mint)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }

@media print {
    .sidebar, .topbar, .app-footer, .btn, .filters { display: none !important; }
    .main { margin: 0 !important; }
}
.min-w-0 { min-width: 0; }
.perm-row > div:last-child { flex: 1; min-width: 0; }

/* ---------- Etapa 2 ---------- */
.risk-row { display: grid; grid-template-columns: 1fr 190px 220px; gap: .75rem; align-items: center; padding: .55rem 1rem; border-bottom: 1px solid #F0F3F4; }
.risk-row:last-child { border-bottom: 0; }
.risk-row .risk-extra { opacity: .35; pointer-events: none; transition: opacity .15s; }
.risk-row.is-on { background: #F6FBF9; }
.risk-row.is-on .risk-extra { opacity: 1; pointer-events: auto; }
.risk-row .form-select, .risk-row .form-control { padding: .35rem .6rem; font-size: .8rem; }
.risk-row .form-select { padding-right: 1.9rem; background-position: right .5rem center; }
.agenda-filtros .form-select { width: auto; min-width: 190px; max-width: 260px; }
@media (max-width: 767.98px) { .risk-row { grid-template-columns: 1fr; } }
.risk-tag { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; font-size: .7rem; font-weight: 800; flex-shrink: 0; }
.rt-fisico { background: #E3F4EC; color: #04764F; } .rt-quimico { background: #FCEAEA; color: #C03535; }
.rt-biologico { background: #FEF3DC; color: #A86A00; } .rt-ergonomico { background: #E8F0FD; color: #2459B8; }
.rt-acidente { background: #DFF6F0; color: #0B7F68; } .rt-ausencia { background: #EEF1F3; color: #55606E; }
.struct-card .list-group-item { border-color: #F0F3F4; padding: .65rem 1rem; display: flex; align-items: center; gap: .6rem; font-size: .86rem; }
.struct-card .list-group-item.inactive { opacity: .55; }
.struct-card .item-actions { margin-left: auto; display: flex; gap: .25rem; opacity: 0; transition: opacity .15s; }
.struct-card .list-group-item:hover .item-actions { opacity: 1; }
@media (hover: none) { .struct-card .item-actions { opacity: 1; } }
.mini-stat { display: flex; flex-direction: column; padding: .85rem 1rem; border: 1px solid var(--pj-line); border-radius: 12px; background: #FAFBFB; }
.mini-stat strong { font-size: 1.35rem; color: var(--pj-ink-strong); line-height: 1.1; }
.mini-stat span { font-size: .75rem; color: var(--pj-muted); }
.import-row-erro td { background: #FFF6F6; }
.import-row-aviso td { background: #FFFBEF; }
.dropzone { border: 2px dashed #C9DCD4; border-radius: 16px; padding: 2rem; text-align: center; background: #F8FBFA; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--pj-green-2); background: #F2FAF7; }
.dropzone i { font-size: 2rem; color: var(--pj-green); }
.photo-frame { width: 96px; height: 96px; border-radius: 22px; object-fit: cover; border: 3px solid #fff; box-shadow: var(--pj-shadow); }

/* ---------- Etapa 3: central de atendimento e agenda ---------- */
.queue-col { background: #EEF2F2; border-radius: 16px; padding: .5rem; height: 100%; min-height: 220px; }
.queue-head { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .85rem; padding: .5rem .6rem .7rem; color: var(--pj-ink-strong); }
.queue-head i { font-size: 1rem; }
.queue-head.tone-green i { color: var(--pj-green); } .queue-head.tone-blue i { color: var(--pj-blue); } .queue-head.tone-amber i { color: #C27F05; } .queue-head.tone-gray i { color: var(--pj-muted); }
.queue-count { background: #fff; border-radius: 20px; padding: .1rem .55rem; font-size: .75rem; color: var(--pj-muted); }
.queue-body { display: flex; flex-direction: column; gap: .5rem; max-height: 62vh; overflow-y: auto; }
.queue-card { background: #fff; border-radius: 12px; padding: .75rem .85rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); border: 1px solid #E6ECEC; }
.queue-num { min-width: 30px; height: 30px; border-radius: 9px; background: var(--pj-green); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; }
.queue-time { font-weight: 700; font-size: .8rem; color: var(--pj-blue); background: #EAF1FD; border-radius: 8px; padding: .15rem .45rem; height: fit-content; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--pj-line); border: 1px solid var(--pj-line); border-radius: 14px; overflow: hidden; }
.cal-grid .cal-h { background: #FAFBFB; padding: .5rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--pj-muted); text-align: center; }
.cal-day { background: #fff; min-height: 104px; padding: .45rem .55rem; font-size: .78rem; color: var(--pj-ink); display: flex; flex-direction: column; gap: .25rem; }
.cal-day:hover { background: #F7FAF9; color: var(--pj-ink); }
.cal-day.out { background: #FAFBFB; color: #B0B8C1; }
.cal-day.today .cal-num { background: var(--pj-green); color: #fff; }
.cal-day.closed { background: repeating-linear-gradient(45deg, #FAFBFB, #FAFBFB 6px, #F3F5F6 6px, #F3F5F6 12px); }
.cal-num { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.cal-pill { border-radius: 6px; padding: .1rem .4rem; font-size: .7rem; font-weight: 600; background: var(--pj-green-soft); color: var(--pj-green); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-pill.blue { background: #EAF1FD; color: #2459B8; }
.slot-row { display: grid; grid-template-columns: 70px 1fr; border-bottom: 1px solid #F0F3F4; min-height: 52px; }
.slot-row:last-child { border-bottom: 0; }
.slot-time { font-weight: 700; font-size: .8rem; color: var(--pj-muted); padding: .7rem .9rem; border-right: 1px solid #F0F3F4; }
.slot-items { padding: .4rem .6rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.slot-row.blocked { background: repeating-linear-gradient(45deg, #FAFBFB, #FAFBFB 6px, #F3F5F6 6px, #F3F5F6 12px); }
.slot-chip { display: inline-flex; gap: .5rem; align-items: center; border: 1px solid #DDE7E3; border-left: 4px solid var(--pj-green-2); border-radius: 10px; padding: .35rem .6rem; background: #fff; font-size: .8rem; color: var(--pj-ink); }
.slot-chip:hover { border-color: var(--pj-green-2); color: var(--pj-ink); }
.slot-chip.st-confirmado { border-left-color: #0B7F68; } .slot-chip.st-agendado { border-left-color: var(--pj-blue); }
.slot-chip.st-faltou { border-left-color: var(--pj-red); opacity: .7; } .slot-chip.st-concluido { border-left-color: var(--pj-green); }
.slot-free { font-size: .75rem; color: #9AA5B1; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: .6rem; overflow-x: auto; }
.week-col { background: #fff; border: 1px solid var(--pj-line); border-radius: 14px; min-height: 240px; display: flex; flex-direction: column; }
.week-col .wk-h { padding: .6rem .75rem; border-bottom: 1px solid var(--pj-line); font-size: .8rem; font-weight: 700; display: flex; justify-content: space-between; }
.week-col.today .wk-h { color: var(--pj-green); }
.week-col .wk-b { padding: .5rem; display: flex; flex-direction: column; gap: .35rem; }

/* ---------- Etapa 4: ficha clínica e ASO ---------- */
.seg { flex-shrink: 0; display: inline-flex; gap: 0; border: 1px solid #DDE3E1; border-radius: 10px; overflow: hidden; background: #fff; }
.seg .btn { border: 0; border-radius: 0; padding: .3rem .7rem; font-size: .8rem; background: #fff; color: var(--pj-dark, #344054); }
.seg .btn + .btn-check + .btn, .seg .btn-check + .btn ~ .btn-check + .btn { border-left: 1px solid #DDE3E1; }
.seg .btn-check:checked + .btn { background: var(--pj-green); color: #fff; }
.seg .btn-check.bad:checked + .btn { background: #D92D20; color: #fff; }
.seg .btn-check.na:checked + .btn { background: #667085; color: #fff; }
.clin-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .55rem 0; border-bottom: 1px dashed #E4E9E7; }
.clin-row:last-child { border-bottom: 0; }
.clin-row .clin-lbl { min-width: 190px; font-weight: 600; font-size: .86rem; }
.clin-row .form-control { max-width: 420px; flex: 1; }
.verdict { display: flex; gap: .75rem; }
.verdict label { flex: 1; border: 2px solid #DDE3E1; border-radius: 14px; padding: .9rem; text-align: center; cursor: pointer; font-weight: 700; transition: .15s; }
.verdict input { display: none; }
.verdict input:checked + span.v-apto { color: var(--pj-green); }
.verdict label:has(input[value=apto]:checked) { border-color: var(--pj-green); background: var(--pj-green-soft); color: var(--pj-green); }
.verdict label:has(input[value=inapto]:checked) { border-color: #D92D20; background: #FEF3F2; color: #B42318; }
.result-box { background: #F7FAF9; border: 1px solid #E4E9E7; border-radius: 12px; padding: .6rem .8rem; font-size: .82rem; }
.lock-note { display: flex; gap: .5rem; align-items: flex-start; background: #FEF7E6; color: #8A5A00; border-radius: 12px; padding: .7rem .9rem; font-size: .84rem; }

.apt-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.seg .btn { white-space: nowrap; }

/* ---------- Etapa 5: páginas públicas, assinatura e validação ---------- */
.pub-body { background: var(--pj-bg, #F4F6F7); min-height: 100vh; }
.pub-header { background: #fff; border-bottom: 1px solid #E4E9E7; padding: .8rem 0; }
.pub-wrap { max-width: 860px; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
.sig-pad { position: relative; border: 2px dashed #A8D5C4; border-radius: 16px; background: #fff; touch-action: none; }
.sig-pad canvas { width: 100%; height: 220px; display: block; border-radius: 14px; cursor: crosshair; }
.sig-pad .sig-line { position: absolute; left: 8%; right: 8%; bottom: 52px; border-top: 1px solid #C7D3CF; pointer-events: none; }
.sig-pad .sig-hint { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; color: #98A2B3; font-size: .8rem; pointer-events: none; }
.steps-pub { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.steps-pub div { flex: 1; height: 6px; border-radius: 6px; background: #E4E9E7; }
.steps-pub div.on { background: var(--pj-green); }
.val-status { border-radius: 18px; padding: 1.25rem 1.4rem; display: flex; gap: 1rem; align-items: center; }
.val-status i { font-size: 2.4rem; }
.val-ok { background: var(--pj-green-soft); color: var(--pj-green); }
.val-warn { background: #FEF7E6; color: #8A5A00; }
.val-bad { background: #FEF3F2; color: #B42318; }
.sig-item { display: flex; gap: .8rem; padding: .8rem 0; border-bottom: 1px dashed #E4E9E7; }
.sig-item:last-child { border-bottom: 0; }
.sig-item .sig-ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--pj-green-soft); color: var(--pj-green); }
.kiosk-big { font-size: 1.05rem; }

/* Etapa 9 — relatórios */
.rel-card { border: 1px solid var(--bs-border-color, #E4E7EC); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.rel-card:hover { transform: translateY(-2px); border-color: #078A69; box-shadow: 0 8px 22px rgba(0, 106, 78, .12); }
.table td.text-end, .table th.text-end { white-space: nowrap; }

/* ===================== Etapa 10 — portais ===================== */
.portal-escolha { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--pj-line); border-radius: var(--pj-radius); color: var(--pj-ink); text-decoration: none; background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; }
.portal-escolha:hover { border-color: var(--pj-green-2); box-shadow: 0 8px 22px rgba(0,106,78,.12); transform: translateY(-1px); color: var(--pj-ink); }
.portal-escolha .pe-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--pj-green-soft); color: var(--pj-green); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.portal-escolha strong { display: block; color: var(--pj-ink-strong); }
.portal-escolha small { display: block; color: var(--pj-muted); font-size: .82rem; }
.portal-body { background: var(--pj-bg); min-height: 100vh; display: flex; flex-direction: column; }
.portal-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.portal-top { background: #fff; border-bottom: 1px solid var(--pj-line); position: sticky; top: 0; z-index: 1020; }
.portal-top > .portal-wrap { min-height: 68px; }
.portal-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.portal-brand img { height: 40px; width: auto; }
.portal-brand .portal-tag { font-size: .72rem; font-weight: 600; color: var(--pj-green); background: var(--pj-green-soft); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.portal-brand strong { display: block; color: var(--pj-green); letter-spacing: .05em; }
.portal-brand small { display: block; color: var(--pj-muted); font-size: .72rem; margin-top: 2px; }
.portal-nav { gap: 2px; margin-left: 18px; }
.portal-nav a, .portal-nav-mobile a { color: var(--pj-ink); text-decoration: none; padding: 9px 13px; border-radius: 10px; font-weight: 500; font-size: .92rem; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.portal-nav a:hover, .portal-nav-mobile a:hover { background: var(--pj-bg); }
.portal-nav a.active, .portal-nav-mobile a.active { background: var(--pj-green-soft); color: var(--pj-green); font-weight: 600; }
.portal-nav-mobile { display: flex; flex-direction: column; padding-top: 6px; padding-bottom: 12px; gap: 2px; border-top: 1px solid var(--pj-line); }
.portal-main { flex: 1; padding-top: 28px; padding-bottom: 36px; }
.portal-footer { color: var(--pj-muted); font-size: .82rem; padding-bottom: 22px; }
.portal-footer a { color: var(--pj-muted); }
.portal-hero { background: linear-gradient(120deg, var(--pj-green-deep), var(--pj-green) 55%, var(--pj-green-2)); color: #fff; border-radius: 20px; padding: 26px 28px; margin-bottom: 24px; position: relative; overflow: hidden; }
.portal-hero h1 { font-size: 1.55rem; margin: 0 0 4px; color: #fff; }
.portal-hero p { margin: 0; opacity: .85; }
.portal-hero .ph-acoes { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.portal-hero .btn-light { background: #fff; color: var(--pj-green); border: 0; font-weight: 600; }
.portal-hero .btn-outline-light { border-color: rgba(255,255,255,.5); }
.portal-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.07); }
.step-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.step-pills span { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--pj-line); font-size: .85rem; color: var(--pj-muted); }
.step-pills span.on { background: var(--pj-green-soft); border-color: var(--pj-green-soft); color: var(--pj-green); font-weight: 600; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot-grid button { border: 1px solid var(--pj-line); background: #fff; border-radius: 10px; padding: 9px 4px; font-weight: 600; color: var(--pj-ink); font-size: .92rem; }
.slot-grid button small { display: block; font-weight: 400; font-size: .7rem; color: var(--pj-muted); }
.slot-grid button:hover:not(:disabled) { border-color: var(--pj-green-2); }
.slot-grid button.sel { background: var(--pj-green); border-color: var(--pj-green); color: #fff; }
.slot-grid button.sel small { color: rgba(255,255,255,.8); }
.slot-grid button:disabled { opacity: .45; text-decoration: line-through; }
.lista-sel { max-height: 360px; overflow: auto; border: 1px solid var(--pj-line); border-radius: 12px; }
.lista-sel label { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--pj-line); cursor: pointer; margin: 0; }
.lista-sel label:last-child { border-bottom: 0; }
.lista-sel label:hover { background: var(--pj-bg); }
.doc-item { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--pj-line); }
.doc-item:last-child { border-bottom: 0; }
.doc-item .di-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--pj-green-soft); color: var(--pj-green); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.chat-msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; margin-bottom: 10px; }
.chat-msg.portal { background: var(--pj-green-soft); margin-left: auto; border-bottom-right-radius: 4px; }
.chat-msg.proteja { background: #fff; border: 1px solid var(--pj-line); border-bottom-left-radius: 4px; }
.chat-msg .cm-meta { font-size: .74rem; color: var(--pj-muted); margin-bottom: 3px; }
@media (max-width: 575px) { .portal-hero { padding: 20px; } .portal-hero h1 { font-size: 1.3rem; } .portal-main { padding-top: 18px; } }

/* ===== Etapa 11: política de privacidade ===== */
.politica h2 { font-size: 1.05rem; font-weight: 700; color: var(--pj-ink-strong); margin: 1.75rem 0 .6rem; }
.politica p, .politica li { line-height: 1.65; }
.politica ul { padding-left: 1.2rem; }
.politica .table { font-size: .9rem; }
.env-banner { position: fixed; z-index: 2000; bottom: 12px; left: 50%; transform: translateX(-50%); background: #A86A00; color: #fff; font-size: .74rem; font-weight: 600; padding: .3rem .85rem; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.18); pointer-events: none; white-space: nowrap; opacity: .92; }
@media print { .env-banner { display: none; } }
.check-item:last-child { border-bottom: 0 !important; }
.manual h2 { font-size: 1.2rem; font-weight: 800; color: var(--pj-ink-strong); margin: 2.2rem 0 .8rem; padding-top: .4rem; border-top: 1px solid var(--bs-border-color, #E4E7EC); scroll-margin-top: 80px; }
.manual h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.manual h3 { font-size: 1rem; font-weight: 700; color: var(--pj-green, #006A4E); margin: 1.4rem 0 .5rem; scroll-margin-top: 80px; }
.manual p, .manual li { line-height: 1.65; }
.manual ul, .manual ol { padding-left: 1.3rem; }
.manual-toc { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }
.manual-toc a { color: var(--pj-ink-strong); text-decoration: none; }
.manual-toc a:hover { color: var(--pj-green, #006A4E); }
.md-code { background: #F4F6F7; border-radius: 8px; padding: .8rem 1rem; font-size: .82rem; }
@media print { .manual-toc, .page-head .btn { display: none !important; } }

/* ===== Portal: cabeçalho responsivo (sem transbordar em telas médias) ===== */
.portal-wrap { max-width: 1440px; }
.portal-top > .portal-wrap { flex-wrap: nowrap; }
.portal-nav { flex: 1 1 auto; min-width: 0; margin-left: 14px; }
@media (max-width: 1439.98px) {
    .portal-brand .portal-tag { display: none !important; }
    .portal-nav { margin-left: 6px; }
    .portal-nav a { padding: 8px 10px; gap: 6px; font-size: .9rem; }
}
@media (max-width: 1279.98px) {
    .portal-top .user-chip-text { display: none !important; }
}
