/* GERAL E LAYOUT */
:root {
    --primary-color: #00833D;
    --primary-dark-color: #00642e;
    --danger-color: #dc3545;
    --secondary-color: #6c757d;
    --light-gray-color: #f8f9fa;
    --dark-text-color: #333;
    --light-text-color: #fff;
    --border-color: #dee2e6;
    --border-radius: 6px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-gray-color);
    color: var(--dark-text-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* CABEÇALHO */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background-color: var(--light-text-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.user-info span {
    font-weight: 600;
    margin-right: 15px;
}

/* BOTÕES */
.btn {
    padding: 10px 20px;
    font-size: 15px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-weight: 600;
}
.btn-primary { background-color: var(--primary-color); color: var(--light-text-color); }
.btn-primary:hover { background-color: var(--primary-dark-color); }
.btn-danger { background-color: var(--danger-color); color: var(--light-text-color); }
.btn-danger:hover { background-color: #c82333; }
.btn-secondary { background-color: var(--secondary-color); color: var(--light-text-color); }
.btn-secondary:hover { background-color: #5a6268; }
.btn-success { background-color: var(--primary-color); color: var(--light-text-color); } 
.btn-success:hover { background-color: var(--primary-dark-color); }

.action-buttons-group {
    text-align: center;
    margin: 30px 0;
    display: flex;
    justify-content: center;
    align-items: center; /* Adicionado para alinhar verticalmente os botões */
    gap: 15px;
    flex-wrap: wrap;
}

/* SEÇÕES */
.content-section {
    background-color: var(--light-text-color);
    padding: 25px;
    margin-top: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

h1, h2, h3 { color: var(--primary-dark-color); }
h2, h3 { text-align: center; }

/* MODAIS COMPATÍVEIS */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; 
    top: 0;
    width: 100%; 
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal.is-visible { 
    display: flex !important; 
}

.modal-content {
    background-color: #fefefe;
    padding: 25px;
    border: none;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    margin: auto;
}

.close-btn {
    position: absolute;
    top: 10px; 
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover { 
    color: #000; 
}

/* FORMULÁRIOS */
.form-group { margin-bottom: 15px; }
.form-row { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; }
.form-row > .form-group { flex: 1; min-width: 150px; }
form label { font-weight: 600; margin-bottom: 5px; display: block; }
form input[type="text"], form input[type="date"], form input[type="time"], form select, form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* HISTÓRICO DE CANCELAMENTOS E FILTROS */
.cancelamentos-lista { 
    list-style: none; 
    padding: 0; 
}
.cancelamentos-lista li { 
    background-color: #fff5f5; 
    border-left: 5px solid var(--danger-color); 
    padding: 15px; 
    margin-bottom: 10px;
    border-radius: 0 4px 4px 0;
}
.cancelamentos-lista strong { color: #b7791f; }
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 5px 0;
}
.checkbox-group label { margin-right: 15px; display: flex; align-items: center; gap: 5px; cursor: pointer; }

/* ESTILOS DO FULLCALENDAR v5 */
.fc {
    border-radius: 8px;
    overflow: hidden;
}
.fc .fc-toolbar-title { font-size: 1.5em; }
.fc .fc-daygrid-day-number {
    padding: 8px;
    font-weight: 600;
}
.fc .fc-day-today {
    background-color: #e6fffa !important;
}
.fc-event {
    border: none !important;
    padding: 5px 8px !important;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 4px;
}

/* Cores dos eventos - Psicóloga */
.fc-event.evento-confirmado { background-color: var(--primary-dark-color) !important; }
.fc-event.evento-disponivel-psicologa { background-color: var(--primary-color) !important; }
.fc-event.evento-indisponivel-psicologa { background-color: var(--secondary-color) !important; }

/* Cores dos eventos - Aluno */
.fc-event.evento-disponivel-aluno { background-color: var(--primary-color) !important; }
.fc-event.evento-meu-agendamento { background-color: #0056b3 !important; } 
.fc-event.evento-indisponivel-aluno { background-color: var(--secondary-color) !important; cursor: not-allowed !important; }

/* RESPONSIVIDADE */
@media (max-width: 768px) {
    .header { flex-direction: column; gap: 10px; padding: 15px; }
    .container { padding: 10px; }
    .content-section { padding: 15px; }
    .action-buttons-group { flex-direction: column; }
    .modal-content { margin: 20% auto; padding: 20px; }
    .form-row { flex-direction: column; }
}

/* ALERTAS FLUTUANTES E AJUSTES DO ALUNO (COMPARTILHADO)*/
.message-box { 
    display: none; 
    padding: 15px; 
    margin: 20px auto; 
    border-radius: 8px; 
    width: 90%; 
    max-width: 500px; 
    text-align: center; 
    color: white; 
    font-weight: bold; 
    position: fixed; 
    top: 80px; 
    left: 50%; 
    transform: translateX(-50%); 
    z-index: 2500;
}
.message-box.success { background-color: var(--primary-color); }
.message-box.error { background-color: var(--danger-color); }

/* Estilos de texto específicos do fluxo do aluno */
.modal-content .data-hora { 
    font-weight: bold; 
    color: var(--primary-dark-color); 
}
.instrucao-texto, .instrucao-subtexto {
    text-align: center; 
    color: #555;
    margin-bottom: 15px;
}

#tabela-historico-aluno th, #tabela-historico-aluno td { padding: 8px; border: 1px solid #ddd; text-align: left; }
    .text-success { color: #00833D; }
    .text-danger { color: #dc3545; }

/* AGENDAMENTOS DE HOJE */

.agenda-hoje-section {
    margin-bottom: 30px;
    border-left: 5px solid #00833D;
    padding-left: 15px;
}

.agenda-hoje-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agenda-hoje-badge {
    background: #00833D;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.agenda-hoje-vazia {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-top: 15px;
    border: 1px dashed #ccc;
}

.agenda-hoje-vazia p {
    color: #666;
    margin: 0;
}

.table-responsive-wrapper {
    overflow-x: auto;
    margin-top: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.table-agenda-hoje {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table-agenda-hoje thead tr {
    background-color: #f4f4f4;
    border-bottom: 2px solid #ddd;
}

.table-agenda-hoje th, 
.table-agenda-hoje td {
    padding: 12px 15px;
}

.table-agenda-hoje tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.table-agenda-hoje tbody tr:hover {
    background-color: #f9f9f9;
}

.table-agenda-hoje .col-hora {
    font-weight: bold;
    color: #00833D;
}

.table-agenda-hoje .col-aluno {
    font-weight: 500;
}

.table-agenda-hoje .col-matricula {
    color: #555;
}

.status-confirmado {
    color: #00833D;
    font-weight: bold;
}

.status-agendado {
    color: #e67e22;
    font-weight: bold;
}

/* MODAL DO AGENDAMENTO DE HOJE */
.btn-acoes-hoje {
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    color: #333;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-acoes-hoje:hover {
    background-color: #00833D;
    border-color: #00833D;
    color: white;
}
@media (max-width: 767px) {
/* Adaptação para uso em celulares — 27/09/2026 */
*, *::before, *::after { box-sizing: border-box; }
.container { width: 100%; min-width: 0; }
.header { gap: 24px; }
.header h1 { min-width: 0; }
.user-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-info span { margin: 0; overflow-wrap: anywhere; }
.user-info form { flex: 0 0 auto; }
.btn { min-height: 44px; line-height: 1.35; white-space: normal; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
button, input, select, textarea { font-family: inherit; }
form input:not([type="checkbox"]):not([type="hidden"]), form select, form textarea {
    min-width: 0; max-width: 100%; font-size: 16px;
}
form input:not([type="checkbox"]):not([type="hidden"]), form select:not([size]) { min-height: 44px; }
input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary-color); }
button:focus-visible, a:focus-visible { outline: 3px solid #0284c7; outline-offset: 3px; }
.content-section { min-width: 0; }
.cancelamentos-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cancelamentos-coluna { flex: none !important; min-width: 0 !important; max-width: none !important; text-align: left; }
.cancelamentos-lista li { overflow-wrap: anywhere; line-height: 1.5; }
.agenda-hoje-header { gap: 12px; flex-wrap: wrap; }
.agenda-hoje-header h2 { margin: 0; text-align: left; }
.agenda-hoje-badge { white-space: nowrap; }
.table-responsive-wrapper { max-width: 100%; min-width: 0; overscroll-behavior-x: contain; }
.table-responsive-wrapper:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.table-agenda-hoje { min-width: 620px; }
.relatorio-table-scroll { overflow-x: auto; max-width: 100%; width: 100%; margin-top: 16px; }
.relatorio-table-scroll #tabela-relatorio { min-width: 640px; margin-top: 0 !important; }
#tabela-relatorio th, #tabela-relatorio td { overflow-wrap: anywhere; }
#tabela-relatorio th:first-child { width: 30%; }
#tabela-relatorio th:nth-child(2), #tabela-relatorio td:nth-child(2) { min-width: 130px; white-space: nowrap; }
#resultado_relatorio { min-width: 0; }
#resultado_relatorio p { overflow-wrap: anywhere; line-height: 1.5; }
#filtro-relatorio-form .form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#filtro-relatorio-form .form-group { min-width: 0; margin-bottom: 0; }
.relatorio-acoes { display: flex; flex-wrap: wrap; gap: 10px; }

/* A caixa cabe no visor e seu conteúdo rola mesmo com o teclado aberto. */
.modal { padding: 12px; height: 100%; height: 100dvh; overscroll-behavior: contain; }
.modal-content {
    width: 100%; max-width: 500px; margin: auto; padding: 24px;
    max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
    overflow-y: auto; overscroll-behavior: contain;
}
.modal-content > h3 { padding-right: 30px; line-height: 1.35; }
.close-btn {
    display: flex; justify-content: center; align-items: center;
    width: 44px; height: 44px; right: 4px; top: 4px; padding: 0;
    border: 0; background: transparent; color: #59616a; line-height: 1;
}
.modal-tabs { padding-right: 24px; }
.modal-tabs .tab-btn { min-height: 44px; font-size: 14px; }
.modal .form-row { margin-bottom: 16px; }
.modal .form-group { margin-bottom: 12px; }
.checkbox-group { gap: 8px; }
.checkbox-group p, .checkbox-group > hr, .checkbox-group > label.selecionar-todos { flex-basis: 100%; margin: 4px 0; }
.checkbox-group label, .horarios-checkbox-grid label { min-height: 44px; margin: 0; display: flex; align-items: center; gap: 8px; padding: 4px 6px; }
.horarios-checkbox-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#modalBuscaProntuario, #modalSenhaProntuario { padding: 12px; overflow-y: auto; height: 100dvh !important; }
#modalBuscaProntuario > div, #modalSenhaProntuario > div {
    min-width: 0; margin: auto !important; max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px); overflow-y: auto !important;
}
#modalBuscaProntuario button, #modalSenhaProntuario button { min-height: 44px; }
#modalBuscaProntuario select { font-size: 16px; }
body:has(.modal.is-visible), body:has(#modalBuscaProntuario[style*="display: flex"]),
body:has(#modalSenhaProntuario[style*="display: flex"]) { overflow: hidden; }

/* Lista semanal: rótulos completos, cor por situação e área de toque maior. */
.fc .fc-list-event { background: transparent !important; }
.fc .fc-list-event td { padding: 14px 10px; }
.fc .fc-list-event-title { white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }
.fc .fc-list-event-title a { color: #333; }
.fc .fc-list-event:hover td { background: #eaf5ee; }
.fc .evento-disponivel-aluno .fc-list-event-dot,
.fc .evento-disponivel-psicologa .fc-list-event-dot { border-color: #00833D; }
.fc .evento-meu-agendamento .fc-list-event-dot { border-color: #0056b3; }
.fc .evento-indisponivel-aluno .fc-list-event-dot,
.fc .evento-indisponivel-psicologa .fc-list-event-dot { border-color: #6c757d; }
.fc .fc-list-day-cushion { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; }
.fc .fc-toolbar-chunk { min-width: 0; }
.fc .fc-button { min-height: 44px; }
.fc .fc-daygrid-event { white-space: normal; }
.fc .fc-daygrid-event .fc-event-title { overflow-wrap: anywhere; }
.fc .fc-timegrid-event .fc-event-main { overflow-wrap: anywhere; }
#tabela-historico-aluno { table-layout: fixed; }
#tabela-historico-aluno td, #tabela-historico-aluno th { overflow-wrap: anywhere; line-height: 1.45; }

@media (max-width: 767px) {
    .header { position: static; align-items: stretch; gap: 16px; padding: 20px 16px; }
    .header h1 { font-size: 24px; line-height: 1.25; margin: 0; text-align: left; }
    .user-info { justify-content: space-between; font-size: 14px; }
    .user-info span { flex: 1; }
    .user-info .btn { padding: 10px 16px; }
    .container { padding: 0 12px 24px; }
    .content-section { margin-top: 18px; padding: 18px 14px; }
    .content-section h2 { font-size: 21px; line-height: 1.3; margin-top: 0; }
    .action-buttons-group { gap: 10px; margin: 18px 0; align-items: stretch; }
    .action-buttons-group > .btn { width: 100%; }
    .agenda-hoje-header { flex-direction: column; align-items: flex-start; }
    .agenda-hoje-header h2 { margin-bottom: 0; }
    .agenda-hoje-section { margin-bottom: 0; }
    .cancelamentos-grid { grid-template-columns: minmax(0, 1fr); gap: 0 !important; }
    #filtro-relatorio-form .form-row { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .relatorio-acoes { flex-direction: column; }
    .relatorio-acoes .btn { width: 100%; }
    .modal-content { padding: 22px 16px 18px; margin: auto; }
    .modal .form-row { gap: 12px; }
    .modal .form-row > .form-group { min-width: 0; flex: auto; margin: 0; }
    .modal form > .btn { width: 100%; margin-top: 10px; }
    #modalBuscaProntuario form, #modalSenhaProntuario form { padding: 18px !important; }
    #modalBuscaProntuario form > div:last-child, #modalSenhaProntuario form > div:last-child { flex-wrap: wrap; }
    #modalBuscaProntuario form > div:last-child button, #modalSenhaProntuario form > div:last-child button { flex: 1 1 110px; }
    .message-box { top: 12px; width: calc(100% - 24px); margin: 0; }
    .fc .fc-header-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
    .fc .fc-toolbar-chunk { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
    .fc .fc-toolbar-chunk:nth-child(2) { order: -1; }
    .fc .fc-toolbar-title { font-size: 20px; line-height: 1.3; text-align: center; }
    .fc .fc-toolbar-chunk > :not(:first-child) { margin-left: 0; }
    .fc .fc-daygrid-day-number { padding: 5px; }
    .fc .fc-daygrid-event { font-size: 11px; padding: 4px 2px !important; }
    .fc .fc-daygrid-dot-event .fc-daygrid-event-dot { display: none; }
    .fc .fc-list-table { table-layout: auto; }
    .fc .fc-list-event-graphic { width: 28px; padding-right: 4px; }
    #tabela-historico-aluno { font-size: 14px; }
}
@media (max-width: 359px) {
    .container { padding-inline: 8px; }
    .content-section { padding-inline: 10px; }
    .header h1 { font-size: 22px; }
    .horarios-checkbox-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

    #filtro-relatorio-form > .btn { width: 100%; }
    #filtro-relatorio-form > .btn + .btn { margin-top: 10px; }
    .checkbox-group > label.selecionar-todos { display: flex !important; }

}
