/* Estilos Gerais */
#solicitadorgc-app {
    font-family: 'Dark Grotesque', sans-serif;
    color: #333333;
    max-width: 100%;
    margin: 0 auto;
}

#solicitadorgc-app h3 {
    color: #000000;
    border-bottom: 2px solid #6AD9AF;
    padding-bottom: 10px;
}

#solicitadorgc-app .button-primary {
    background-color: #6AD9AF;
    border-color: #58bf9a;
    color: #333;
    font-weight: bold;
}
#solicitadorgc-app .button-primary:hover {
    background-color: #58bf9a;
    border-color: #4aad8a;
}
#solicitadorgc-app .button {
    transition: background-color 0.2s ease-in-out;
}

/* Seções */
.sgc-config-section, .sgc-request-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.sgc-form-group {
    margin-bottom: 15px;
}

.sgc-form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.sgc-form-group textarea, .sgc-form-group input[type="text"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

/* Info do Paciente */
.sgc-patient-info {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.sgc-patient-info input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Templates */
.sgc-templates-section {
    background: #eef9f5;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}
.sgc-templates-section select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
}
.sgc-save-template {
    display: flex;
    gap: 10px;
    align-items: center;
}
.sgc-save-template input {
    flex-grow: 1;
    padding: 8px;
}

/* Abas (Tabs) */
.sgc-tab-links {
    list-style: none;
    padding: 0;
    margin: 0 0 -1px 0;
    display: flex;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.sgc-tab-links li a {
    padding: 10px 15px;
    display: block;
    text-decoration: none;
    color: #333333;
    background: #eee;
    border: 1px solid #ddd;
    border-bottom: 1px solid #6AD9AF;
    margin-right: 5px;
    margin-bottom: -1px;
    border-radius: 5px 5px 0 0;
}
.sgc-tab-links li.active a {
    background-color: #6AD9AF;
    color: #000000;
    border: 1px solid #6AD9AF;
    border-bottom: 1px solid #6AD9AF;
}
.sgc-tab-content {
    border: 1px solid #6AD9AF;
    padding: 20px;
    border-radius: 0 5px 5px 5px;
    background: #fff;
}
.sgc-tab { display: none; }
.sgc-tab.active { 
    display: block;
    -moz-column-count: 3;
    -webkit-column-count: 3;
    column-count: 3;
}

/* Checkboxes */
.sgc-checkbox-wrapper {
    display: block;
    margin-bottom: 8px;
    break-inside: avoid-column;
}
.sgc-checkbox-wrapper input[type="checkbox"] {
    margin-right: 8px;
}

/* Justificativa e Ações */
.sgc-justification {
    margin-top: 20px;
}
.sgc-justification input {
    width: 100%;
    padding: 10px;
}

.sgc-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Feedback messages */
.sgc-feedback {
    margin-left: 10px;
    font-style: italic;
    color: #008000;
}
/* Estilos para os campos inferiores (Justificativa e Data) */
.sgc-bottom-fields {
    display: flex;
    gap: 20px; /* Espaço entre os campos */
    margin-top: 20px;
    align-items: flex-end; /* Alinha os campos pela base */
}

.sgc-bottom-fields .sgc-justification {
    flex: 3; /* Faz o campo de justificativa ocupar mais espaço */
    margin: 0;
}
.sgc-bottom-fields .sgc-justification input {
    width: 100%;
    padding: 10px;
}
.sgc-bottom-fields .sgc-justification label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}


.sgc-bottom-fields .sgc-form-group {
    flex: 1; /* Faz o campo de data ocupar menos espaço */
}

/* Oculta o placeholder do campo de justificativa quando focado, se desejar */
#sgc-cid-justification:focus::-webkit-input-placeholder { color:transparent; }
#sgc-cid-justification:focus:-moz-placeholder { color:transparent; }
#sgc-cid-justification:focus::-moz-placeholder { color:transparent; }
#sgc-cid-justification:focus:-ms-input-placeholder { color:transparent; }
/* --- NOVOS ESTILOS PARA A ESTRUTURA DE ABAS PRINCIPAL --- */
.sgc-main-tab-links {
    list-style: none;
    padding: 0;
    margin: 0 0 -1px 0;
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #6AD9AF;
}
.sgc-main-tab-links li a {
    padding: 12px 20px;
    display: block;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
    background: #f0f0f0;
}
.sgc-main-tab-links li.active a {
    background: #fff;
    border: 2px solid #6AD9AF;
    border-bottom: 2px solid #fff;
    position: relative;
    top: 2px;
}
.sgc-main-tab-links li.disabled a {
    color: #999;
    background: #f7f7f7;
    cursor: not-allowed;
}
.sgc-main-tab { display: none; }
.sgc-main-tab.active { display: block; }
.sgc-main-tab-content {
    background: #fff;
    padding-top: 20px;
}
.sgc-main-tab .sgc-request-section {
    margin: 0;
    border-top: none;
    border-radius: 0 5px 5px 5px;
}


/* --- NOVOS ESTILOS PARA O FORMULÁRIO DE PRESCRIÇÃO --- */
.sgc-medication-block {
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
    background: #fdfdfd;
}
.sgc-remove-medication {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f1f1f1;
    border: 1px solid #ccc;
    cursor: pointer;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    font-weight: bold;
}
.sgc-medication-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 15px;
}
.sgc-duration-group {
    display: flex;
    gap: 10px;
    align-items: center;
}
.sgc-duration-group input { flex-grow: 1; }
.sgc-duration-group select { flex-grow: 2; }

/* --- NOVOS ESTILOS PARA O HISTÓRICO --- */
.sgc-history-section {
    margin-top: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 5px;
}
.sgc-history-list {
    list-style: none;
    padding: 0;
}
.sgc-history-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}
.sgc-history-list li:last-child {
    border-bottom: none;
}
/* --- ESTILOS PARA IMPRESSÃO DA PRESCRIÇÃO --- */

.print-main.prescription-body {
    /* Remove as colunas que usamos para os exames */
    column-count: 1; 
}

.medication-item {
    /* Espaço entre cada medicação */
    margin-bottom: 1cm;
    padding-left: 10px;
}

/* Zera as margens padrão dos parágrafos dentro do item */
.medication-item p {
    margin: 0 0 5px 0;
    font-size: 11pt;
}

/* Estilo para a "Via de Administração" */
.med-via {
    font-style: italic;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px !important;
}

/* Estilo para o "Nome do Medicamento" */
.med-name p{
    font-weight: bold !important; /* Força o negrito */
    font-size: 13pt !important;   /* Força o tamanho da fonte */
    margin-left: 10px;
    color: #000;
}
/* Estilo para a "Posologia" */
.med-posology {
    margin-left: 25px;
    font-style: italic;
}
/* Estilo para o campo de busca do histórico */
#sgc-history-search {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}