/* --- GERAL E LAYOUT --- */
:root {
    --primary-color: #0056b3;
    --primary-hover: #004494;
    --secondary-color: #6c757d;
    --secondary-hover: #5a6268;
    
    /* CORES ATUALIZADAS PARA MAIOR CONTRASTE */
    --danger-color: #c82333;  /* Vermelho mais forte */
    --danger-hover: #a51c29;
    --edit-color: #0069d9;    /* Azul mais vibrante para edição */
    --edit-hover: #0056b3;

    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --shadow: 0 4px 8px rgba(0,0,0,0.1);
}
body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--light-bg);
    color: #333;
    margin: 0;
}
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}
.screen { display: none; }
.screen.active { display: block; }

/* --- CABEÇALHOS --- */
.main-header, .app-header {
    display: flex;
    align-items: center;
    padding: 15px 30px;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
}
.main-header {
    background-color: var(--primary-color);
    color: white;
}
.header-logo {
    height: 50px;
    margin-right: 20px;
}
.header-text h1 {
    margin: 0;
    font-size: 1.4em;
    line-height: 1.1;
}
.header-text .header-subtitle {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.9;
}
.main-header .header-text .header-subtitle {
    color: #e9ecef;
}
.app-header .header-title {
    display: flex;
    align-items: center;
}
.app-header {
    justify-content: space-between;
}
.header-user-area {
    text-align: right;
}
#user-info {
    font-size: 0.9em;
    color: #555;
    display: block;
    margin-bottom: 5px;
}
.header-actions {
    display: flex;
    gap: 10px;
}

/* --- CONTEÚDO PRINCIPAL --- */
main {
    padding: 20px 30px;
}
.content-box {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-top: 20px;
}

/* --- TOOLBAR (BARRA DE FERRAMENTAS) --- */
.toolbar {
    margin-bottom: 20px;
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

/* --- FORMULÁRIOS --- */
form {
    padding: 10px 0;
}
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: bold; color: #555; font-size: 0.9em; }
input[type="text"], input[type="password"], input[type="email"], input[type="date"], select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
    font-family: 'Roboto', sans-serif;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 86, 179, 0.3);
}
.form-actions {
    text-align: right;
    margin-top: 20px;
}
.checkbox-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 15px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
}
.checkbox-item {
    display: flex;
    align-items: center;
}

/* --- BOTÕES (COM NOVAS CLASSES) --- */
button, .button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    text-transform: uppercase;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    color: white;
    display: inline-block;
}
button:hover, .button:hover {
    transform: translateY(-2px);
}
button.primary, .button.primary { background-color: var(--primary-color); color: white; }
button.primary:hover, .button.primary:hover { background-color: var(--primary-hover); }

button.secondary, .button.secondary { background-color: var(--secondary-color); color: white; }
button.secondary:hover, .button.secondary:hover { background-color: var(--secondary-hover); }

button.danger, .button.danger { background-color: var(--danger-color); color: white; }
button.danger:hover, .button.danger:hover { background-color: var(--danger-hover); }

button.edit { background-color: var(--edit-color); color: white; }
button.edit:hover { background-color: var(--edit-hover); }


/* --- TABELAS --- */
.table-wrapper {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
th, td {
    border-bottom: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}
thead th {
    background-color: #f2f2f2;
    font-size: 0.85em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}
tr:nth-child(even) { background-color: #fdfdfd; }
tr:hover { background-color: #f1f1f1; }
td button {
    padding: 5px 10px;
    font-size: 0.8em;
    margin-right: 5px;
}

/* --- MODAL (POP-UP) --- */
#modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; justify-content: center; align-items: center; z-index: 1000; }
/* START-REPLACE-BLOCK-MODAL-CSS */
#modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px; /* Aumentei um pouco a largura para o formulário */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    
    /* NOVAS PROPRIEDADES PARA A BARRA DE ROLAGEM */
    max-height: 85vh; /* Define a altura máxima como 85% da altura da tela */
    overflow-y: auto; /* Adiciona a barra de rolagem vertical apenas se necessário */
}
/* END-REPLACE-BLOCK-MODAL-CSS */
#modal-content h2 { margin-top: 0; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 20px; }

/* --- MENSAGENS DE ALERTA --- */
.message{padding: 15px; border-radius: 5px; margin: 20px 0; display: none; text-align: center; font-weight: bold;}
.message.success{background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb;}
.message.error{background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb;}
/* START-ADD-BLOCK-CALENDAR-CSS */

/* --- ESTILOS DO CALENDÁRIO DE ESCALAS --- */
.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #e0e0e0;
    border: 1px solid #e0e0e0;
}
.calendar-header {
    font-weight: bold;
    text-align: center;
    padding: 8px;
    background-color: #f5f5f5;
}
.calendar-day {
    min-height: 100px;
    padding: 5px;
    background-color: white;
    font-size: 0.9em;
}
.day-number {
    font-weight: bold;
    margin-bottom: 5px;
    text-align: right;
}
.assignment {
    padding: 3px 5px;
    border-radius: 4px;
    margin-top: 3px;
    font-size: 0.8em;
    color: white;
}
.assignment.sobreaviso {
    background-color: #17a2b8; /* Azul-claro */
}
.assignment.plantao-d {
    background-color: #ffc107; /* Amarelo */
    color: #333;
}
.assignment.plantao-n {
    background-color: #343a40; /* Cinza escuro */
}
/* Estilos para a Janela Modal de Avisos */

/* O fundo escurecido que cobre a página */
#modal-overlay {
    /* ... (você já deve ter este estilo, verifique se está conforme abaixo) ... */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* Inicia escondido */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* O container branco da janela */
#modal-content {
    /* ... (você já deve ter este estilo, verifique se está conforme abaixo) ... */
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 600px;
    z-index: 1001;
}

/* Estilos específicos para o formulário de avisos dentro da janela */
#notices-form h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
    color: #333;
}

#notices-form p {
    margin-bottom: 20px;
    color: #555;
    line-height: 1.5;
}

#notices-form .form-group {
    margin-bottom: 20px;
}

#notices-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical; /* Permite que o usuário redimensione verticalmente */
}

#notices-form .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* END-ADD-BLOCK-CALENDAR-CSS */