/* ============================================================
   DOCUMENTOS MÉDICOS — CSS
   ============================================================ */

/* ── Botão de perfil no header ── */
.doc-btn-perfil {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.83rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.doc-btn-perfil:hover {
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.doc-btn-perfil--destaque {
    gap: 0.6rem;
    padding: 0.6rem 1.1rem;
    border-color: var(--primary, #6366f1);
    border-width: 2px;
    box-shadow: 0 2px 8px rgba(99,102,241,0.10);
}
.doc-btn-perfil--destaque i {
    font-size: 1.1rem;
    color: var(--primary, #6366f1);
}
.doc-btn-perfil--destaque:hover {
    background: #f5f3ff;
    box-shadow: 0 4px 14px rgba(99,102,241,0.18);
}
.doc-btn-perfil-texto {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}
.doc-btn-perfil-texto strong {
    font-size: 0.85rem;
    color: var(--primary, #6366f1);
}
.doc-btn-perfil-texto small {
    font-size: 0.72rem;
    font-weight: 400;
    color: #94a3b8;
}

/* ── Mobile nav tabs ── */
.doc-mobile-nav {
    display: none;
    gap: 0;
    margin-bottom: 1rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
}
.doc-mobile-tab {
    flex: 1;
    padding: 0.65rem;
    background: #fff;
    border: none;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.doc-mobile-tab.active {
    background: var(--primary, #2563eb);
    color: #fff;
}

/* ── Layout principal ── */
.doc-layout {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    min-height: calc(100vh - 200px);
}

/* ── Painel esquerdo ── */
.doc-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 14px;
    overflow: hidden;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* ── Buscador ── */
.doc-buscador {
    position: relative;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    flex-shrink: 0;
}
.doc-search-ico {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.8rem;
    pointer-events: none;
}
.doc-buscador input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.1rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.82rem;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.doc-buscador input:focus {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    background: #fff;
}

/* ── Lista de categorias ── */
#doc-lista-categorias {
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem 0;
}
#doc-lista-categorias::-webkit-scrollbar { width: 4px; }
#doc-lista-categorias::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

/* ── Categoria accordion ── */
.doc-categoria {
    margin-bottom: 0.15rem;
}

.doc-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #94a3b8;
    transition: color 0.15s;
}
.doc-cat-header:hover { color: #64748b; }
.doc-cat-chevron {
    font-size: 0.6rem;
    transition: transform 0.2s;
    color: #cbd5e1;
}
.doc-cat-header.collapsed .doc-cat-chevron { transform: rotate(-90deg); }

.doc-cat-items {
    overflow: hidden;
    transition: max-height 0.2s ease;
}
.doc-cat-items.collapsed { max-height: 0 !important; }

/* ── Item de documento ── */
.doc-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.9rem 0.5rem 1.1rem;
    cursor: pointer;
    font-size: 0.83rem;
    color: #374151;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1.3;
}
.doc-item:hover {
    background: #f1f5f9;
    color: #1e40af;
}
.doc-item.active {
    background: #eff6ff;
    color: var(--primary, #2563eb);
    border-left-color: var(--primary, #2563eb);
    font-weight: 600;
}
.doc-item i {
    font-size: 0.75rem;
    flex-shrink: 0;
    color: #94a3b8;
}
.doc-item.active i { color: var(--primary, #2563eb); }

/* ── Painel direito ── */
.doc-painel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Título do documento selecionado ── */
.doc-titulo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ── Formulário dinâmico ── */
.doc-form {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.doc-empty-hint {
    color: #94a3b8;
    font-size: 0.85rem;
    text-align: center;
    padding: 2rem 0;
    margin: 0;
}
.doc-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}
.doc-form-grid .doc-field-full {
    grid-column: 1 / -1;
}

/* ── Campos de formulário ── */
.doc-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.doc-field label {
    font-size: 0.77rem;
    font-weight: 600;
    color: #374151;
}
.doc-field input[type="text"],
.doc-field input[type="date"],
.doc-field select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    box-sizing: border-box;
}
.doc-field input:focus,
.doc-field select:focus {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    background: #fff;
}
.doc-field-row {
    display: flex;
    gap: 0.85rem;
}
.doc-field-row .doc-field { flex: 1; }

/* ── Radio e Checkbox ── */
.doc-radio-group,
.doc-check-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.35rem 0;
}
.doc-radio-group label,
.doc-check-group label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 400;
    color: #374151;
    cursor: pointer;
    line-height: 1.4;
}
.doc-radio-group label input,
.doc-check-group label input {
    margin-top: 0.15rem;
    flex-shrink: 0;
    accent-color: var(--primary, #2563eb);
}
.doc-check-group-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    padding: 0.35rem 0;
}
.doc-check-group-inline label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 400;
    color: #374151;
    cursor: pointer;
}
.doc-check-group-inline label input {
    accent-color: var(--primary, #2563eb);
}

/* ── Preview label ── */
.doc-preview-wrap {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.doc-preview-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border, #e2e8f0);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}
.doc-badge-editavel {
    background: #fef9c3;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 5px;
    padding: 0.15rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

/* ── Textarea de preview ── */
.doc-preview {
    width: 100%;
    min-height: 280px;
    padding: 1.25rem;
    border: none;
    outline: none;
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: #1e293b;
    background: #fff;
    resize: vertical;
    box-sizing: border-box;
}

/* ── Botões de ação ── */
.doc-acoes {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 1rem;
}

.btn-copiar {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    background: #fbbf24;
    color: #78350f;
    border: none;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.btn-copiar:hover { background: #f59e0b; transform: translateY(-1px); }
.btn-copiar:active { transform: translateY(0); }

.doc-pdf-container {
    position: relative;
}
.btn-gerar-pdf {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    background: #0d9488;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.btn-gerar-pdf:hover { background: #0f766e; transform: translateY(-1px); }
.btn-gerar-pdf:active { transform: translateY(0); }
.doc-pdf-chevron {
    font-size: 0.65rem;
    transition: transform 0.2s;
    margin-left: 0.1rem;
}
.doc-pdf-chevron.open { transform: rotate(180deg); }

.doc-pdf-options {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.13);
    overflow: hidden;
    display: none;
    min-width: 160px;
    z-index: 100;
}
.doc-pdf-options.open { display: block; }
.doc-pdf-options button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: none;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
}
.doc-pdf-options button:hover { background: #f1f5f9; }
.doc-pdf-options button + button { border-top: 1px solid var(--border, #e2e8f0); }

/* ── Toast ── */
#doc-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.doc-toast {
    background: #0f172a;
    color: #fff;
    padding: 0.7rem 1.1rem;
    border-radius: 10px;
    font-size: 0.83rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: toastIn 0.25s ease;
}
.doc-toast.success { background: #16a34a; }
.doc-toast.error   { background: #dc2626; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Modal genérico ── */
.doc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.doc-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
}
.doc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.doc-modal-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.doc-modal-close {
    background: none;
    border: none;
    font-size: 1rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.15s;
}
.doc-modal-close:hover { color: #0f172a; }
.doc-modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.doc-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border, #e2e8f0);
}
.doc-btn-cancel {
    padding: 0.5rem 1.1rem;
    background: #f1f5f9;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
}
.doc-btn-cancel:hover { background: #e2e8f0; }
.doc-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    background: var(--primary, #2563eb);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.doc-btn-primary:hover { background: #1d4ed8; }

/* ── Modal campos ── */
.doc-modal-body .doc-field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
}
.doc-modal-body .doc-field input,
.doc-modal-body .doc-field select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.doc-modal-body .doc-field input:focus,
.doc-modal-body .doc-field select:focus {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    background: #fff;
}
.doc-modal-body .doc-field-row {
    display: flex;
    gap: 0.75rem;
}
.doc-modal-body .doc-field-row .doc-field { flex: 1; }

/* ── Dark mode ── */
[data-theme="dark"] .doc-sidebar,
[data-theme="dark"] .doc-form,
[data-theme="dark"] .doc-titulo,
[data-theme="dark"] .doc-preview-wrap,
[data-theme="dark"] .doc-modal,
[data-theme="dark"] .doc-pdf-options {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .doc-preview-label { background: #0f172a; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .doc-preview { background: #1e293b; color: #e2e8f0; }
[data-theme="dark"] .doc-item { color: #cbd5e1; }
[data-theme="dark"] .doc-item:hover { background: #334155; color: #93c5fd; }
[data-theme="dark"] .doc-item.active { background: #1e3a5f; color: #60a5fa; border-left-color: #3b82f6; }
[data-theme="dark"] .doc-buscador input,
[data-theme="dark"] .doc-field input,
[data-theme="dark"] .doc-field select,
[data-theme="dark"] .doc-modal-body .doc-field input,
[data-theme="dark"] .doc-modal-body .doc-field select { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .doc-titulo { color: #f1f5f9; }
[data-theme="dark"] .doc-modal-header h2,
[data-theme="dark"] .doc-field label,
[data-theme="dark"] .doc-modal-body .doc-field label { color: #e2e8f0; }
[data-theme="dark"] .doc-pdf-options button { color: #cbd5e1; }
[data-theme="dark"] .doc-pdf-options button:hover { background: #334155; }
[data-theme="dark"] .doc-btn-cancel { background: #334155; border-color: #475569; color: #e2e8f0; }
[data-theme="dark"] .doc-btn-perfil { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .doc-btn-perfil--destaque { border-color: var(--primary, #6366f1); }
[data-theme="dark"] .doc-btn-perfil--destaque:hover { background: #1e1b4b; }
[data-theme="dark"] .doc-btn-perfil-texto small { color: #64748b; }
[data-theme="dark"] .doc-mobile-tab { background: #1e293b; color: #94a3b8; }
[data-theme="dark"] .doc-mobile-nav { border-color: #334155; }
[data-theme="dark"] .doc-radio-group label,
[data-theme="dark"] .doc-check-group label,
[data-theme="dark"] .doc-check-group-inline label { color: #cbd5e1; }

/* ── Responsivo ── */
@media (max-width: 768px) {
    .doc-mobile-nav { display: flex; }
    .doc-layout { display: block; }
    .doc-sidebar {
        position: static;
        width: 100%;
        max-height: none;
        margin-bottom: 1rem;
    }
    .doc-sidebar.hidden,
    .doc-painel.hidden { display: none; }
    .doc-form-grid { grid-template-columns: 1fr; }
    .doc-field-row { flex-direction: column; }
}

/* ── Logo upload ── */
.logo-upload-area {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    min-height: 90px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    padding: 12px;
    background: #f8fafc;
}
.logo-upload-area:hover {
    border-color: var(--primary, #2563eb);
    background: #eff6ff;
}
[data-theme="dark"] .logo-upload-area {
    background: #0f172a;
    border-color: #334155;
}

/* ── Print overlay (escondido na tela, visível só ao imprimir) ── */
#doc-print-overlay {
    display: none;
}

/* ── Estilos do PDF ── */
.pdf-page {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 11.5pt;
    color: #111;
    max-width: 100%;
    padding: 0;
}

/* SUS header — Instituição (esq) + logo SUS (dir) */
.pdf-sus-header-new {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 2px solid #1a56a0;
    margin-bottom: 22px;
}
.pdf-sus-header-new svg { display: block; flex-shrink: 0; }
.pdf-sus-inst-info { flex: 1; }
.pdf-sus-inst-nome {
    font-family: Arial, sans-serif;
    font-weight: 900;
    font-size: 12pt;
    color: #1a56a0;
    line-height: 1.2;
}
.pdf-sus-inst-sub {
    font-family: Arial, sans-serif;
    font-size: 7.5pt;
    color: #374151;
    margin-top: 3px;
    letter-spacing: 0.02em;
}

/* Legado (mantido para não quebrar possível referência externa) */
.pdf-sus-header {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #005BAC;
    color: white;
    padding: 12px 20px;
    border-radius: 6px 6px 0 0;
    margin-bottom: 24px;
}
.pdf-sus-logo { flex-shrink: 0; }
.pdf-sus-text { flex: 1; }
.pdf-sus-title {
    font-family: Arial, sans-serif;
    font-weight: 900;
    font-size: 12pt;
    letter-spacing: 0.04em;
    line-height: 1.2;
}
.pdf-sus-sub {
    font-family: Arial, sans-serif;
    font-size: 7.5pt;
    opacity: 0.85;
    margin-top: 3px;
    letter-spacing: 0.02em;
}
.pdf-sus-bandeira {
    font-size: 22pt;
    flex-shrink: 0;
}

/* Particular com logo */
.pdf-clinic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 2.5px solid #1e40af;
    margin-bottom: 22px;
}
.pdf-clinic-logo {
    max-height: 72px;
    max-width: 200px;
    object-fit: contain;
}
.pdf-clinic-med { text-align: right; }

/* Particular sem logo */
.pdf-particular-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 2.5px solid #1e40af;
    margin-bottom: 22px;
}
.pdf-particular-accent {
    width: 5px;
    height: 44px;
    background: #1e40af;
    border-radius: 3px;
    flex-shrink: 0;
}
.pdf-particular-info {}

.pdf-med-nome {
    font-family: Arial, sans-serif;
    font-weight: 700;
    font-size: 11pt;
    color: #111;
}
.pdf-med-crm {
    font-family: Arial, sans-serif;
    font-size: 9pt;
    color: #374151;
    margin-top: 2px;
}

/* Título do documento */
.pdf-titulo {
    text-align: center;
    font-family: Arial, sans-serif;
    font-weight: 900;
    font-size: 13pt;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #111;
    margin-bottom: 10px;
}
.pdf-divisor {
    border: none;
    border-top: 2px solid #1e40af;
    margin-bottom: 28px;
}

/* Corpo do documento */
.pdf-corpo {
    font-size: 11pt;
    line-height: 1.75;
    text-align: justify;
    white-space: pre-wrap;
    color: #111;
}

/* Rodapé com assinatura */
.pdf-rodape {
    margin-top: 80px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}
.pdf-local-data {
    text-align: right;
    font-family: Arial, sans-serif;
    font-size: 9pt;
    color: #374151;
}
.pdf-data-auto {
    display: block;
    font-weight: 600;
    font-size: 9pt;
    color: #111;
}
.pdf-linha-assin-mini {
    border-top: 1px solid #555;
    width: 170px;
    margin: 0 auto 5px;
}
.pdf-assinatura {
    text-align: center;
    font-family: Arial, sans-serif;
}
.pdf-linha-assin {
    border-top: 1.5px solid #111;
    width: 260px;
    margin: 0 auto 6px;
}
.pdf-ass-nome {
    display: block;
    font-size: 10pt;
    font-weight: 700;
    color: #111;
    line-height: 1.5;
}
.pdf-ass-crm {
    display: block;
    font-size: 9pt;
    color: #374151;
}

/* ── @media print: esconde tudo, mostra só o overlay ── */
@media print {
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

    /* Largura fixa em cm (não %): no Safari do iOS o print usa a largura da
       viewport do celular em vez do tamanho físico da página, cortando o
       conteúdo à direita. A4 retrato e A5 paisagem (os dois formatos gerados
       em documentos.js) têm a mesma largura de página, 21cm. */
    html, body {
        width: 21cm !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: white !important;
    }

    body > *:not(#doc-print-overlay) {
        display: none !important;
    }

    #doc-print-overlay {
        display: block !important;
        position: static !important;
        width: 21cm !important;
        height: auto !important;
        background: white !important;
        z-index: 99999;
        box-sizing: border-box;
    }

    .pdf-page {
        width: 21cm !important;
        box-sizing: border-box !important;
        page-break-inside: avoid;
    }

    /* Evita corte de texto no mobile */
    .pdf-corpo {
        orphans: 3;
        widows: 3;
    }

    .pdf-rodape {
        page-break-inside: avoid;
    }

    .pdf-sus-header-new svg,
    .pdf-sus-header svg {
        display: block !important;
    }
}

/* ══════════════════════════════════════════════
   DARK MODE — documentos.css
   ══════════════════════════════════════════════ */
[data-theme="dark"] .doc-badge-editavel {
    background: #292007;
    color: #fcd34d;
    border-color: #78350f;
}
