* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f7f9fb;
    color: #1f2937;
    font-size: 13px;
}

/* LOGIN */

.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #f7f9fb, #eaf7f1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 850px;
    min-height: 430px;
    background: #ffffff;
    border-radius: 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.login-brand {
    background: #ecfdf5;
    padding: 55px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand h1 {
    font-size: 42px;
    color: #047857;
    margin-bottom: 5px;
}

.login-brand p {
    font-size: 13px;
    color: #065f46;
    margin-bottom: 25px;
}

.login-brand span {
    font-size: 18px;
    line-height: 1.5;
    color: #1f2937;
}

.login-card {
    padding: 55px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card h2 {
    font-size: 24px;
    margin-bottom: 6px;
    color: #111827;
}

.login-card p {
    color: #6b7280;
    margin-bottom: 25px;
}

.login-card label {
    font-size: 12px;
    color: #374151;
    margin-bottom: 6px;
}

.login-card input {
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 0 12px;
    margin-bottom: 15px;
    outline: none;
}

.login-card input:focus {
    border-color: #10b981;
}

.login-card button {
    height: 44px;
    border: none;
    border-radius: 12px;
    background: #10b981;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    margin-top: 5px;
}

.login-card button:hover {
    background: #059669;
}

.erro {
    background: #fef2f2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 12px;
}

/* SISTEMA */

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 24px 16px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #047857;
}

.sublogo {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 30px;
}

.sidebar nav a {
    display: block;
    text-decoration: none;
    color: #4b5563;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 5px;
    font-size: 13px;
}

.sidebar nav a:hover,
.sidebar nav a.ativo {
    background: #ecfdf5;
    color: #047857;
    font-weight: bold;
}

.sidebar nav a.sair {
    margin-top: 25px;
    color: #b91c1c;
}

.main {
    flex: 1;
    padding: 26px 30px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.topbar h1 {
    font-size: 22px;
    color: #111827;
    margin-bottom: 4px;
}

.topbar p {
    color: #6b7280;
    font-size: 12px;
}

.btn-principal {
    background: #10b981;
    color: #ffffff;
    text-decoration: none;
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.btn-principal:hover {
    background: #059669;
}

.layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.card h2 {
    font-size: 15px;
    color: #111827;
    margin-bottom: 15px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.card-header h2 {
    margin-bottom: 0;
}

.card-header span {
    font-size: 12px;
    color: #6b7280;
}

.agenda-item {
    display: grid;
    grid-template-columns: 70px 1fr 130px 110px;
    gap: 12px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid #f1f5f9;
}

.agenda-item:last-child {
    border-bottom: none;
}

.hora {
    font-weight: bold;
    color: #047857;
}

.paciente strong {
    display: block;
    font-size: 13px;
    color: #111827;
}

.paciente span {
    color: #6b7280;
    font-size: 11px;
}

.medico {
    color: #4b5563;
    font-size: 12px;
}

.status {
    text-align: center;
    padding: 6px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
}

.status-agendado {
    background: #eff6ff;
    color: #1d4ed8;
}

.status-confirmado {
    background: #ecfdf5;
    color: #047857;
}

.status-aguardando {
    background: #fffbeb;
    color: #b45309;
}

.status-atendido {
    background: #eef2ff;
    color: #4338ca;
}

.status-cancelado {
    background: #fef2f2;
    color: #b91c1c;
}

.status-faltou {
    background: #f3f4f6;
    color: #4b5563;
}

.vazio {
    padding: 35px;
    text-align: center;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 16px;
}

.resumo {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat {
    background: #f9fafb;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    padding: 14px;
}

.stat span {
    color: #6b7280;
    font-size: 11px;
}

.stat strong {
    display: block;
    font-size: 22px;
    margin-top: 5px;
    color: #111827;
}

.acoes a {
    display: block;
    text-decoration: none;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #eef2f7;
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 9px;
    font-size: 12px;
}

.acoes a:hover {
    background: #ecfdf5;
    color: #047857;
}

.mensagem {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-size: 12px;
}

.layout-pacientes {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 20px;
    align-items: flex-start;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full {
    grid-column: span 2;
}

.form-group label {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.busca-box input {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12px;
    color: #1f2937;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.busca-box input:focus {
    border-color: #10b981;
}

.form-grid .btn-principal {
    border: none;
    cursor: pointer;
    grid-column: span 2;
    text-align: center;
}

.busca-box {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.busca-box input {
    flex: 1;
}

.busca-box button {
    border: none;
    background: #10b981;
    color: white;
    padding: 0 18px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.tabela-wrapper {
    overflow-x: auto;
}

.tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.tabela th {
    text-align: left;
    color: #6b7280;
    font-weight: 600;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.tabela td {
    padding: 13px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
}

.tabela tr:hover td {
    background: #f9fafb;
}

.link-acao {
    text-decoration: none;
    color: #047857;
    font-weight: 600;
    margin-right: 10px;
    font-size: 12px;
}

.sem-registro {
    text-align: center;
    color: #6b7280;
    padding: 25px !important;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
    row-gap: 14px;
    width: 100%;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group input,
.form-group textarea {
    width: 100%;
}

.card {
    overflow: hidden;
}

.form-group select,
.busca-box input[type="date"] {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12px;
    color: #1f2937;
    outline: none;
    width: 100%;
}

.form-group select:focus,
.busca-box input[type="date"]:focus {
    border-color: #10b981;
}

.layout-prontuario {
    display: grid;
    grid-template-columns: 1fr 430px;
    gap: 20px;
    align-items: flex-start;
}

.paciente-resumo {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 18px;
}

.paciente-resumo strong {
    display: block;
    color: #064e3b;
    font-size: 14px;
    margin-bottom: 4px;
}

.paciente-resumo span {
    color: #047857;
    font-size: 12px;
}

.form-prontuario {
    margin-top: 10px;
}

.historico-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.historico-item {
    background: #f9fafb;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    padding: 14px;
}

.historico-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #111827;
}

.historico-topo span {
    font-size: 11px;
    color: #6b7280;
}

.historico-item p {
    font-size: 12px;
    line-height: 1.5;
    color: #374151;
    margin-bottom: 8px;
}

.historico-item p:last-child {
    margin-bottom: 0;
}

.lista-pacientes-busca {
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    max-height: 170px;
    overflow-y: auto;
}

.paciente-opcao {
    display: block;
    padding: 11px 13px;
    text-decoration: none;
    color: #374151;
    font-size: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.paciente-opcao:last-child {
    border-bottom: none;
}

.paciente-opcao:hover {
    background: #ecfdf5;
    color: #047857;
    font-weight: 600;
}

.lista-pacientes-busca {
    display: none;
}
.btn-secundario {
    background: #ffffff;
    color: #047857;
    border: 1px solid #a7f3d0;
    text-decoration: none;
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.btn-secundario:hover {
    background: #ecfdf5;
}

.aviso-prontuario {
    max-width: 650px;
}

.aviso-prontuario h2 {
    margin-bottom: 8px;
}

.aviso-prontuario p {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 18px;
}

.paciente-resumo-prontuario {
    margin-bottom: 20px;
}

.receita-layout {
    display: flex;
    justify-content: center;
}

.receita-print {
    background: white;
    width: 850px;
    min-height: 1000px;
    border-radius: 22px;
    padding: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}

.receita-topo {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 50px;
}

.receita-topo h1 {
    font-size: 28px;
    color: #111827;
    margin-bottom: 8px;
}

.receita-topo span {
    color: #6b7280;
    font-size: 13px;
}

.receita-data {
    font-size: 13px;
    color: #6b7280;
}

.receita-paciente {
    margin-bottom: 40px;
}

.receita-paciente p {
    margin-bottom: 10px;
    font-size: 15px;
    color: #374151;
}

.receita-formulario label {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
    color: #374151;
    font-weight: 600;
}

.receita-formulario textarea {
    width: 100%;
    min-height: 420px;
    border: none;
    resize: none;
    outline: none;
    font-size: 16px;
    line-height: 1.8;
    color: #111827;
    font-family: Arial;
}

.receita-rodape {
    margin-top: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.assinatura-linha {
    width: 320px;
    height: 1px;
    background: #111827;
    margin-bottom: 14px;
}

.select-medico {
    border: none;
    background: transparent;
    font-size: 14px;
    text-align: center;
    outline: none;
    color: #111827;
}

@media print {

    .sidebar,
    .topbar,
    .btn-principal {
        display: none !important;
    }

    body {
        background: white;
    }

    .main {
        padding: 0;
    }

    .receita-print {
        box-shadow: none;
        border-radius: 0;
        width: 100%;
        min-height: auto;
    }

}

.agenda-item-plus {
    grid-template-columns: 70px 1fr 130px 130px 170px;
}

.status-form {
    margin: 0;
}

.status-select {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 7px 9px;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    outline: none;
    cursor: pointer;
}

.status-select.status-agendado {
    background: #eff6ff;
    color: #1d4ed8;
}

.status-select.status-confirmado {
    background: #ecfdf5;
    color: #047857;
}

.status-select.status-aguardando {
    background: #fffbeb;
    color: #b45309;
}

.status-select.status-atendido {
    background: #eef2ff;
    color: #4338ca;
}

.status-select.status-cancelado {
    background: #fef2f2;
    color: #b91c1c;
}

.status-select.status-faltou {
    background: #f3f4f6;
    color: #4b5563;
}

.agenda-acoes {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.agenda-acoes a {
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 7px 9px;
    border-radius: 999px;
}

.agenda-acoes a:hover {
    background: #d1fae5;
}

.editar-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: flex-start;
}

.painel-edicao p {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 18px;
}

.alerta-financeiro {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 14px;
    border-radius: 16px;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 18px;
}

.btn-bloco {
    display: block;
    text-align: center;
}

.agenda-controles {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.agenda-tabs {
    display: flex;
    gap: 8px;
}

.agenda-tabs a {
    text-decoration: none;
    color: #047857;
    background: #ffffff;
    border: 1px solid #a7f3d0;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.agenda-tabs a.ativo,
.agenda-tabs a:hover {
    background: #10b981;
    color: #ffffff;
}

.agenda-navegacao {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.agenda-navegacao a {
    text-decoration: none;
    color: #374151;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 9px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.agenda-navegacao a:hover {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.semana-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(130px, 1fr));
    gap: 14px;
    width: 100%;
}

.semana-dia {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 14px;
    min-height: 230px;
}

.semana-dia-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #111827;
}

.semana-dia-topo strong {
    font-size: 13px;
}

.semana-dia-topo span {
    font-size: 11px;
    color: #6b7280;
}

.semana-acoes {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.semana-acoes a,
.mes-acoes a {
    text-decoration: none;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.semana-consulta {
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 9px;
    margin-bottom: 8px;
}

.semana-consulta strong {
    display: block;
    color: #047857;
    font-size: 12px;
    margin-bottom: 3px;
}

.semana-consulta span {
    display: block;
    color: #111827;
    font-size: 12px;
    margin-bottom: 3px;
}

.semana-consulta small {
    color: #6b7280;
    font-size: 10px;
}

.semana-vazio {
    color: #9ca3af;
    font-size: 12px;
    text-align: center;
    padding: 28px 0;
}

.mes-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.mes-cabecalho {
    margin-bottom: 10px;
}

.mes-cabecalho div {
    text-align: center;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
}

.mes-dia {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    min-height: 125px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.vazio-mes {
    background: transparent;
    border: none;
}

.mes-numero {
    font-weight: 700;
    color: #111827;
    font-size: 14px;
}

.mes-consultas {
    color: #047857;
    background: #ecfdf5;
    border-radius: 999px;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.mes-sem {
    color: #9ca3af;
    font-size: 11px;
    text-align: center;
}

.mes-acoes {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

/* MELHORIAS AGENDA SEMANA E MÊS */

.semana-consulta,
.mes-consulta-item {
    cursor: pointer;
    transition: 0.2s;
}

.semana-consulta:hover,
.mes-consulta-item:hover {
    transform: translateY(-1px);
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.semana-consulta small {
    display: inline-block;
    margin-top: 4px;
    background: #f3f4f6;
    padding: 3px 7px;
    border-radius: 999px;
}

.mes-dia {
    min-height: 155px;
}

.mes-lista-consultas {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 8px 0;
}

.mes-consulta-item {
    background: #f9fafb;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    padding: 6px;
    font-size: 10px;
    line-height: 1.3;
}

.mes-consulta-item strong {
    color: #047857;
    display: block;
}

.mes-consulta-item span {
    color: #111827;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mais-consultas {
    font-size: 10px;
    color: #6b7280;
    text-align: center;
}

/* MODAL */

.modal-fundo {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-fundo.ativo {
    display: flex;
}

.modal-card {
    width: 430px;
    max-width: 92%;
    background: #ffffff;
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
}

.modal-topo {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.modal-topo h2 {
    font-size: 18px;
    color: #111827;
    margin-bottom: 4px;
}

.modal-topo p {
    font-size: 12px;
    color: #6b7280;
}

.modal-fechar {
    border: none;
    background: #f3f4f6;
    color: #374151;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: bold;
}

.modal-info {
    background: #f9fafb;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 16px;
}

.modal-info p {
    font-size: 12px;
    color: #374151;
    margin-bottom: 8px;
}

.modal-info p:last-child {
    margin-bottom: 0;
}

.modal-acoes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.modal-acoes a {
    text-decoration: none;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.modal-acoes .verde {
    background: #10b981;
    color: white;
}

.modal-acoes .claro {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}