/* --- ESTILOS GERAIS E LAYOUT (BASE PLUGIN A) --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* O ID principal foi renomeado */
#app-mednotes-assistente {
    font-family: 'Roboto', sans-serif;
    color: #333;
    background-color: #f9f9f9;
}

.main-layout {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
}

.coluna {
    flex: 1;
    min-width: 300px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

#coluna-selecao {
    flex-basis: 100%;
}

.coluna h2 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: bold;
    color: #1565c0;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.descricao-coluna {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 15px;
    color: #555;
}

/* --- NOVOS ESTILOS PARA ABAS --- */
.coluna-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 15px;
}
.tab-btn {
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    color: #555;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.tab-btn:hover {
    color: #1565c0;
}
.tab-btn.active {
    color: #1565c0;
    border-bottom-color: #1565c0;
}

.tab-panel {
    display: none;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden; /* Para conter os layouts internos */
}
.tab-panel.active {
    display: flex;
}
/* --- FIM DOS NOVOS ESTILOS PARA ABAS --- */


/* --- COLUNA 1: ANAMNESE (BASE PLUGIN A) --- */
.coluna-header {
    flex-shrink: 0;
}

.botao-modal-trigger {
    width: 100%;
    padding: 10px;
    border: 1px solid #1565c0;
    color: #1565c0;
    background-color: #fff;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.botao-modal-trigger:hover {
    background-color: #e3f2fd;
    color: #0d47a1;
}

.coluna-body {
    display: flex;
    gap: 20px;
    overflow: hidden;
    flex-grow: 1;
    flex-direction: column; /* As abas exigem isso */
}

/* NOVO: Layout interno do painel de Anamnese */
.anamnese-content-layout {
    display: flex;
    gap: 20px;
    overflow: hidden;
    flex-grow: 1;
}
/* FIM NOVO */

#an-quick-nav {
    flex: 0 0 180px;
    overflow-y: auto;
    border-right: 1px solid #eee;
    padding-right: 20px;
}
#an-quick-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: sticky;
    top: 10px;
}
#an-quick-nav a {
    display: block;
    padding: 8px 10px;
    text-decoration: none;
    color: #333;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    margin-bottom: 5px;
}
#an-quick-nav a:hover {
    background-color: #f5f5f5;
}
#an-quick-nav a.active {
    background-color: #e3f2fd;
    color: #1565c0;
    border-left: 3px solid #1565c0;
}

#anamnese-wrapper {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 10px;
    height: 70vh; 
}

.secao-anamnese {
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.secao-titulo {
    font-weight: bold;
    color: #333;
    cursor: pointer;
    padding: 12px;
    background-color: #f5f5f5;
    user-select: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.secao-titulo h3 {
    margin: 0;
    font-size: 16px;
}

.limpar-secao-btn {
    margin-left: auto;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    background-color: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.limpar-secao-btn:hover {
    background-color: #d1d1d1;
}

.seta-expansao {
    margin-right: 10px;
    transition: transform 0.3s ease;
}
.seta-expansao.recolhido {
    transform: rotate(-90deg);
}

.secao-conteudo {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}

.campo-wrapper {
    margin-bottom: 15px;
}
.campo-wrapper.hidden {
    display: none;
}
.campo-wrapper label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 15px;
}

.campo-wrapper input[type="text"], .campo-wrapper textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    box-sizing: border-box;
}
.campo-wrapper input.small {
    width: 100px;
}
.hda-template h4 {
    font-size: 15px;
    color: #1565c0;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-top: 0;
}

.suggestions-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.suggestion-btn {
    background-color: #e8f0fe;
    color: #1967d2;
    border: 1px solid #d2e3fc;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
}
.suggestion-btn:hover {
    background-color: #d2e3fc;
}

/* Conflito de Anamnese: .choice-wrapper e .selectable-option */
#panel-anamnese .choice-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
#panel-anamnese .selectable-option {
    background-color: #f1f3f4;
    color: #3c4043;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
}
#panel-anamnese .selectable-option:hover {
    background-color: #e8eaed;
}
#panel-anamnese .selectable-option.active {
    background-color: #1976d2;
    color: white;
    font-weight: 500;
    border-color: #1976d2;
}

.inline-other-input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    width: 150px;
}

.checklist-wrapper { display: flex; flex-direction: column; gap: 5px; }
.check-label { font-weight: normal; }

.toggle-btn {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #555;
}
.toggle-btn:hover {
    background-color: #e9e9e9;
}
.toggle-btn.negative {
    background-color: #fff;
    border: 1px solid #ccc;
    color: #777;
    font-style: italic;
}
.toggle-btn.positive {
    background-color: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.grupo-is { 
    margin-top: 15px; 
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}
.grupo-is-titulo {
    font-weight: bold;
    color: #333;
    padding: 10px;
    background-color: #fafafa;
    user-select: none;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 5px;
    border: 1px solid #f0f0f0;
}
.grupo-is-titulo.clicavel {
    cursor: pointer;
}
.grupo-is-titulo.clicavel:hover {
    background-color: #f0f0f0;
}
.grupo-is-titulo-texto {
    display: flex;
    align-items: center;
    flex-grow: 1;
}
.grupo-is-titulo h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}
.btn-negar-todos {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    background-color: #e0e0e0;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-negar-todos:hover {
    background-color: #d1d1d1;
}

.grupo-is-conteudo {
    padding: 10px 0 0 15px;
    border-left: 2px solid #f5f5f5;
    margin-left: 5px;
}

.add-other-is-btn {
    width: 100%;
    padding: 8px;
    background-color: #f8f9fa;
    border: 1px dashed #bdc1c6;
    color: #1565c0;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 15px;
}
.add-other-is-btn:hover {
    background-color: #e8f0fe;
    border-color: #1565c0;
}
.custom-is-items-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.custom-is-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.custom-is-input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}
.remove-custom-is-btn {
    background-color: #fce8e6;
    color: #c5221f;
    border: 1px solid #f28b82;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    text-align: center;
    flex-shrink: 0;
}
.remove-custom-is-btn:hover {
    background-color: #f9d8d6;
}

/* --- COLUNA 2: REVISÃO (MASTER) --- */
#revisao-lista {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.empty-state-placeholder {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    color: #aaa;
    margin: 10px;
}
.empty-state-placeholder svg {
    stroke: #ccc;
    margin-bottom: 15px;
}
.empty-state-placeholder h4 {
    margin: 0;
    font-size: 16px;
    color: #888;
}
.empty-state-placeholder p {
    margin: 5px 0 0 0;
    font-size: 14px;
    max-width: 250px;
}

.revisao-item {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 4px solid transparent;
    transition: border-left 0.3s;
}
.revisao-titulo {
    padding: 10px;
    background-color: #f5f5f5;
    cursor: grab;
    transition: background-color 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.revisao-titulo.clicavel {
    cursor: pointer;
}
.revisao-titulo .titulo-texto::before {
    content: '▼';
    margin-right: 8px;
    font-size: 12px;
    display: inline-block;
    transition: transform 0.2s ease-in-out;
}
.revisao-titulo.recolhido .titulo-texto::before {
    transform: rotate(-90deg);
}
.revisao-titulo h4 {
    margin: 0;
    font-size: 15px;
    flex-grow: 1;
}
.botoes-reordenar {
    display: flex;
    gap: 5px;
}
.btn-mover-cima, .btn-mover-baixo {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: #555;
    font-size: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, border-color 0.2s;
}
.btn-mover-cima:hover, .btn-mover-baixo:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}
.revisao-preview {
    padding: 10px;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    border-top: 1px solid #eee;
}
.revisao-item-placeholder {
    background-color: #e3f2fd;
    border: 2px dashed #1976d2;
    height: 60px;
    margin-bottom: 10px;
    border-radius: 5px;
}

/* --- COLUNA 3: TEXTO FINAL (MASTER) --- */
.texto-final-opcoes {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
}
.opcao-siglas {
    display: flex;
    align-items: center;
    gap: 5px;
}
.opcao-siglas label {
    font-size: 14px;
    color: #555;
    cursor: pointer;
}
.botoes-acao {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* --- Estilos de Design para Dropdown (v2.10) */

.dropdown-btn, #botao-limpar-tudo {
    padding: 8px 12px;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    height: 38px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.dropdown-btn::after {
    content: '▼';
    font-size: 10px;
    margin-left: 8px;
    opacity: 0.7;
}

#botao-limpar-tudo { background-color: #757575; }
#botao-limpar-tudo:hover { background-color: #616161; }

.dropdown-btn {
    background-color: #007bff;
}
.dropdown-btn:hover {
    background-color: #0069d9;
}
.dropdown-btn.active {
    background-color: #0062cc;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

.botoes-acao .dropdown-menu:nth-of-type(2) .dropdown-btn {
    background-color: #17a2b8;
}
.botoes-acao .dropdown-menu:nth-of-type(2) .dropdown-btn:hover {
    background-color: #138496;
}
.botoes-acao .dropdown-menu:nth-of-type(2) .dropdown-btn.active {
    background-color: #117a8b;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

.dropdown-menu {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 190px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    z-index: 100;
    right: 0;
    top: 100%; 
    margin-top: 5px; 
    overflow: hidden;
}

.dropdown-content a {
    color: #333;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: block; 
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background-color: #e3f2fd;
    color: #1565c0;
}

.dropdown-content a.dropdown-item-danger:hover {
    background-color: #fce8e6;
    color: #c5221f;
}

.dropdown-content.show {
    display: block;
}


#texto-final-gerado {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    flex-grow: 1;
    padding: 10px;
}

/* --- ESTILOS PARA RED FLAGS --- */
.campo-wrapper.red-flag-active .toggle-btn.positive {
    background-color: #fce8e6;
    border-color: #f28b82;
    color: #c5221f;
    font-weight: bold;
}
.revisao-item.red-flag-active {
    border-left: 4px solid #d93025;
}
.revisao-item.red-flag-active .revisao-titulo {
    background-color: #fce8e6;
}

/* --- INDICADOR DE PROGRESSO --- */
#an-quick-nav li.completed a {
    color: #2e7d32;
}
#an-quick-nav li.completed a::before {
    content: '✓ ';
    font-weight: bold;
    color: #28a745;
}

/* --- ESTILOS DE AVISO E GUIA --- */
.aviso-secao {
    font-size: 13px;
    color: #666;
    background-color: #f8f9fa;
    border-left: 3px solid #1565c0;
    padding: 10px 12px;
    margin: 0 0 15px 0;
    line-height: 1.5;
    border-radius: 0 5px 5px 0;
}
.aviso-secao ul {
    padding-left: 20px;
    margin-top: 8px;
    margin-bottom: 8px;
}
.aviso-secao li {
    margin-bottom: 4px;
}

.guia-estatico-lista {
    list-style: none;
    padding-left: 5px;
    margin: 0;
}
.guia-estatico-lista li {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
    font-size: 15px;
}
.guia-estatico-lista li::before {
    content: '□';
    margin-right: 12px;
    color: #999;
}
.guia-estatico-lista li:last-child {
    border-bottom: none;
}

/* --- ESTILOS PARA CAMPO REPEATER (MEDICAMENTOS) --- */
.repeater-items-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}
.repeater-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background-color: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}
.repeater-item-fields {
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap; 
    gap: 8px;
}
.repeater-item-fields input[type="text"] {
    margin: 0;
    border-color: #ddd;
    font-size: 14px;
}
.repeater-item-fields input.large {
    flex: 2 1 200px; 
}
.repeater-item-fields input.medium {
    flex: 1 1 120px; 
}

.remove-repeater-btn {
    background-color: #fce8e6;
    color: #c5221f;
    border: 1px solid #f28b82;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-weight: bold;
    padding: 0;
    flex-shrink: 0;
    transition: background-color 0.2s;
    font-size: 1.2em;
    line-height: 0;
}
.remove-repeater-btn:hover {
    background-color: #f9d8d6;
}
.add-repeater-btn {
    width: 100%;
    padding: 8px;
    background-color: #e8f5e9;
    border: 1px dashed #a5d6a7;
    color: #2e7d32;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 5px;
    transition: background-color 0.2s, border-color 0.2s;
}
.add-repeater-btn:hover {
    background-color: #dcedc8;
    border-color: #81c784;
}

/* --- ESTILOS PARA TOAST NOTIFICATIONS --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

@keyframes toast-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

.toast-message {
    padding: 12px 20px;
    border-radius: 6px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: toast-in 0.4s ease-out forwards;
}

.toast-message.hide {
    animation: toast-out 0.4s ease-in forwards;
}

.toast-success { background-color: #28a745; }
.toast-info { background-color: #17a2b8; }
.toast-warning { background-color: #ffc107; color: #212529; }

/* --- MODAL DE MODELOS (PLUGIN A) --- */
#modal-modelos-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

#modal-modelos-content {
    display: none; 
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    flex-direction: column;
}

.modal-modelos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}
.modal-modelos-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1565c0;
}

#modal-modelos-close {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
}
#modal-modelos-close:hover {
    color: #333;
}

.modal-modelos-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    padding: 0 20px;
}
.modal-tab-btn {
    background: none;
    border: none;
    padding: 12px 15px;
    font-size: 15px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}
.modal-tab-btn:hover {
    color: #1565c0;
}
.modal-tab-btn.active {
    color: #1565c0;
    border-bottom-color: #1565c0;
}

.modal-modelos-body {
    flex-grow: 1;
    overflow-y: auto;
    background-color: #f9f9f9;
}
.modal-modelos-panel {
    display: none;
    padding: 20px;
}
.modal-modelos-panel.active {
    display: block;
}

.modelo-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.modelo-card:hover {
    border-color: #1565c0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
.modelo-card h5 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}
.modelo-card p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.modelos-empty-state {
    text-align: center;
    padding: 30px;
    color: #888;
}
.modelos-empty-state p {
    font-size: 15px;
    margin: 0 0 10px 0;
}
/* --- FIM DO CSS DO PLUGIN A --- */


/* ==========================================================================
   INÍCIO DA FUSÃO - ESTILOS DO PLUGIN B (EXAME FÍSICO)
==========================================================================
*/

/* --- ESTILOS DA COLUNA 1 (PLUGIN B) --- */
#panel-exame-fisico {
    /* O painel de aba é o novo container flex */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden; /* Garante que os filhos rolem */
}

#seletor-genero {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f0f5fb;
    border-radius: 5px;
    border: 1px solid #e3f2fd;
    flex-shrink: 0; /* Não encolher */
}
#seletor-genero .genero-label {
    font-weight: 500;
    color: #1565c0;
}
#seletor-genero label {
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.opcoes-coluna-1 {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    flex-shrink: 0; /* Não encolher */
}
.linha-botoes {
    display: flex;
    gap: 10px;
}

.container-pesquisa {
    position: relative;
}

#caixa-pesquisa {
    width: 100%;
    padding: 10px 30px 10px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

#limpar-pesquisa {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-size: 22px;
    line-height: 1;
    display: none;
    user-select: none;
}
#limpar-pesquisa:hover {
    color: #333;
}

/* IDs RENOMEADOS NO PHP */
#limpar-selecao-exame, #minimizar-todos-exame {
    padding: 8px 15px;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    flex-grow: 1;
    transition: background-color: 0.2s;
}
#limpar-selecao-exame {
    background-color: #f44336;
}
#limpar-selecao-exame:hover {
    background-color: #d32f2f;
}
#minimizar-todos-exame {
    background-color: #1976d2;
}
#minimizar-todos-exame:hover {
    background-color: #1565c0;
}
/* FIM DOS IDs RENOMEADOS */


#lista-wrapper {
    overflow-y: auto; 
    flex-grow: 1; 
    padding-right: 5px;
    /* altura do wrapper do exame fisico */
    height: 60vh;
}

.categoria-titulo {
    font-weight: bold;
    color: #333;
    cursor: pointer;
    padding: 8px 10px; 
    background-color: #f5f5f5;
    border-radius: 5px;
    margin-top: 10px;
    user-select: none;
    font-size: 14px; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color: 0.2s;
}

.subcategoria-titulo {
    color: #333;
    cursor: pointer;
    padding: 7px 10px; 
    background-color: #fafafa;
    border-radius: 5px;
    margin-top: 5px;
    user-select: none;
    font-size: 13px; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color: 0.2s;
}

.titulo-texto {
    flex-grow: 1;
}

.categoria-titulo:hover, .subcategoria-titulo:hover {
    background-color: #eef;
}
.categoria-titulo.tem-selecao, .subcategoria-titulo.tem-selecao {
    background-color: #e3f2fd !important;
    color: #0d47a1;
    font-weight: bold;
}
/* A classe .seta-expansao já existe no Plugin A e é compatível */

.categoria-conteudo, .subcategoria-conteudo {
    padding-left: 15px;
}

.opcao-item {
    display: block;
    padding: 6px 5px; 
    transition: background-color: 0.2s;
    border-radius: 4px;
    font-size: 14px; 
    margin: 2px 0;
    font-weight: 400; 
}

.opcao-item:hover {
    background-color: #eef;
}

/* --- ESTILOS PARA O MODELO PADRÃO EXPANSÍVEL (PLUGIN B) --- */
.modelo-padrao-wrapper {
    background-color: #f0f5fb;
    border-left: 3px solid #1976d2;
    margin: 10px 0;
    border-radius: 4px;
}
.modelo-padrao-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 5px; 
}
.modelo-padrao-header label {
    cursor: pointer;
    flex-grow: 1;
}
.modelo-padrao-header strong {
    color: #1565c0;
    font-weight: 500;
}
.seta-expansao-modelo {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 12px;
    color: #1565c0;
    cursor: pointer; /* A seta é o gatilho para expandir */
    padding: 5px;
}
.seta-expansao-modelo.recolhido {
    transform: rotate(-90deg);
}
.sub-opcoes-modelo {
    padding-left: 25px;
    padding-bottom: 5px;
}
.sub-opcao-item {
    display: block;
    padding: 4px 5px; 
    font-size: 13px; 
    font-weight: 400;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
}
.sub-opcao-item:hover {
    background-color: #e3f2fd;
}

/* --- BOTÕES CUSTOMIZADOS (PLUGIN B) --- */
.btn-add-custom {
    width: 100%;
    padding: 8px;
    background-color: #f8f9fa;
    border: 1px dashed #bdc1c6;
    color: #1565c0;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
}
.btn-add-custom:hover {
    background-color: #e8f0fe;
    border-color: #1565c0;
}
.opcao-custom-item {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 0;
    margin-top: 10px;
}
.input-custom {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.btn-remove-custom {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background-color 0.2s;
}
.btn-remove-custom:hover {
    background-color: #d32f2f;
}

/* --- AÇÕES RÁPIDAS (PLUGIN B) --- */
.acoes-rapidas {
    display: none;
    gap: 8px;
}
.categoria-titulo.clicavel:hover .acoes-rapidas {
    display: flex;
}
.acoes-rapidas button {
    background-color: transparent;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s;
    font-size: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
}
.btn-limpar-categoria {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%235f6368"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>');
}
.acoes-rapidas button:hover {
    background-color: #e8eaed;
}

/* --- ESTILOS DE OPÇÕES INLINE (PLUGIN B - AGORA ISOLADOS) --- */
#panel-exame-fisico .texto-wrapper {
    display: inline;
    line-height: 2.2;
}
#panel-exame-fisico .choice-wrapper, 
#panel-exame-fisico .input-wrapper {
    display: inline-block;
    margin: 0 3px;
}
#panel-exame-fisico .selectable-option {
    background-color: #f1f3f4;
    color: #3c4043;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color: 0.2s, color: 0.2s;
    margin: 0 2px;
    border: 1px solid #e0e0e0;
    user-select: none;
}
#panel-exame-fisico .selectable-option:hover {
    background-color: #e8eaed;
}
#panel-exame-fisico .selectable-option.active {
    background-color: #1976d2;
    color: white;
    font-weight: 500;
    border-color: #1976d2;
}
#panel-exame-fisico .inline-input {
    border: none;
    border-bottom: 1px solid #ccc;
    background-color: #f9f9f9;
    padding: 2px 4px;
    text-align: center;
    width: 40px;
    font-size: 15px;
    border-radius: 2px;
}
#panel-exame-fisico .inline-input:focus {
    outline: none;
    border-bottom: 2px solid #1976d2;
}
#panel-exame-fisico .input-suffix {
    margin-left: 2px;
}

#mensagem-sem-resultados {
    text-align: center;
    padding: 20px;
    color: #777;
    font-style: italic;
}


/* --- ESTILOS RESPONSIVOS (MERGIDOS DO PLUGIN B) --- */
@media (max-width: 960px) {
    .main-layout {
        flex-direction: column; /* Empilha as colunas */
        gap: 20px; /* Aumenta o espaço vertical */
    }

    .coluna {
        max-height: none; /* Remove a altura máxima */
        min-width: 0; /* Permite que a coluna seja mais estreita */
    }

    /* Faz a lista de seleção rolar independentemente em telas pequenas */
    #anamnese-wrapper {
        max-height: 500px;
        height: auto; /* Remove altura fixa */
    }
    #lista-wrapper {
        max-height: 500px;
        height: auto; /* Remove altura fixa */
    }
}