:root {
    --primary-color: #3498db; --danger-color: #c0392b; --success-color: #27ae60;
    --light-bg-color: #f4f7f6; --dark-text-color: #2c3e50;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light-bg-color); color: #333; margin: 0; padding: 2rem;
}
.container {
    background-color: #fff; padding: 2rem; border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); max-width: 1100px; margin: 0 auto;
}
h1, h2, h3, h4 { color: var(--dark-text-color); }
.form-group { margin-bottom: 1rem; }
.form-section { border-top: 1px solid #eee; padding-top: 1rem; margin-top: 1rem; }
label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
input[type="month"], input[type="text"], input[type="number"], input[type="date"], textarea, select {
    width: 100%; padding: 0.75rem; border: 1px solid #bdc3c7;
    border-radius: 4px; font-size: 1rem; box-sizing: border-box;
}
button {
    padding: 0.8rem; background-color: var(--primary-color); color: #fff;
    border: none; border-radius: 4px; font-size: 1rem; font-weight: bold;
    cursor: pointer; transition: background-color 0.3s ease; width: 100%;
}
button:hover { background-color: #2980b9; }
.add-btn { background-color: var(--success-color); }
.add-btn:hover { background-color: #229954; }

/* Navegação e Telas */
header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 1rem; margin-bottom: 1rem;}
header h1 { margin: 0; font-size: 1.8rem;}
.view-switcher { display: flex; border-bottom: none; margin: 0; }
.view-switcher button {
    background: none; border: none; padding: 0.5rem 1rem; cursor: pointer; font-size: 1rem;
    color: var(--primary-color); border-bottom: 3px solid transparent; width: auto;
}
.view-switcher button.active { border-bottom-color: var(--primary-color); font-weight: bold; }

/* Formulários e Listas genéricas */
.inline-form { display: flex; gap: 10px; align-items: center; }
.inline-form input { flex-grow: 1; }
.inline-form button { width: auto; font-size: 0.9rem; }
.list-item {
    display: flex; justify-content: space-between; align-items: center; padding: 10px;
    background-color: #f9f9f9; border: 1px solid #eee; border-radius: 4px; margin-bottom: 5px;
}
.remove-btn {
    background: none; border: none; color: var(--danger-color); font-size: 1.5rem;
    cursor: pointer; padding: 0 5px; width: auto;
}

/* Lista de Escalas */
.schedule-item { 
    display: flex; justify-content: space-between; align-items: center; padding: 1rem;
    border: 1px solid #eee; border-radius: 6px; margin-bottom: 1rem; background-color: #f9f9f9;
    cursor: pointer;
}
.schedule-info strong { display: block; font-size: 1.1rem; }
.schedule-info span { color: #666; font-size: 0.9rem; }
.schedule-actions .action-btn {
    padding: 0.4rem 0.8rem; margin-left: 0.5rem; font-size: 0.9rem; width: auto;
    border: 1px solid #ccc; background-color: #fff;
}
.schedule-actions .pdf-btn { color: #2980b9; border-color: #2980b9; }
.schedule-actions .edit-btn { color: #f39c12; border-color: #f39c12; }
.schedule-actions .delete-btn { color: #c0392b; border-color: #c0392b; }

/* Seleção de Funcionários no Modal */
#employee-selection-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px;
    background-color: #fdfdfd; border: 1px solid #ccc; padding: 10px; border-radius: 4px;
}
.checkbox-group { display: flex; align-items: center; background-color: #f0f4f8; padding: 8px; border-radius: 4px; }
.checkbox-group input { width: 18px; height: 18px; margin-right: 10px; }
.checkbox-group label { margin-bottom: 0; font-weight: normal; }

/* Férias e Continuidade Manual */
.initial-state-item {
    display: grid; grid-template-columns: 1fr 100px;
    align-items: center; gap: 15px; margin-bottom: 8px;
}
.initial-state-item label { margin: 0; font-weight: normal; }
.initial-state-item input { width: 100px; }
#initial-state-section p { margin-top: 0; }

/* Tabela de Pré-visualização */
#schedule-preview-table-container { overflow-x: auto; margin-bottom: 1rem; }
.preview-table { border-collapse: collapse; width: 100%; font-size: 0.8rem; }
.preview-table th, .preview-table td { border: 1px solid #ccc; padding: 5px; text-align: center; min-width: 30px;}
.preview-table th { background-color: #f2f2f2; position: sticky; top: 0; z-index: 1;}
.preview-table .employee-name-cell { text-align: left; font-weight: bold; min-width: 150px; position: sticky; left: 0; background-color: #f9f9f9; border-right: 2px solid #ccc; z-index: 2;}
.shift-F { background-color: #f8d7da; color: #721c24; } /* Folga */
.shift-FE { background-color: #d1ecf1; color: #0c5460; font-weight: bold; } /* Feriado */
.shift-\# { background-color: #cce5ff; color: #004085; } /* Férias */

/* Relatórios */
#schedule-report-container ul { list-style: none; padding: 0; column-count: 3; gap: 20px;}
#schedule-report-container li { margin-bottom: 5px; background-color: #f9f9f9; padding: 8px; border-radius: 4px;}
#schedule-report-container li strong { color: var(--primary-color); }

/* Loading e Modal */
.hidden { display: none !important; }
#loading {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(255, 255, 255, 0.7); display: flex;
    justify-content: center; align-items: center; z-index: 2000;
}
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1); width: 36px; height: 36px;
    border-radius: 50%; border-left-color: #3498db; animation: spin 1s ease infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.modal {
    position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto; background-color: rgba(0,0,0,0.6); display: flex;
    justify-content: center; align-items: center; padding: 1rem;
}
.modal-content { max-width: 800px; background-color: #fff; padding: 2rem; border-radius: 8px; width: 90%; position: relative; max-height: 90vh; overflow-y: auto; }
.close-btn {
    color: #aaa; position: absolute; top: 10px; right: 20px;
    font-size: 28px; font-weight: bold; cursor: pointer;
}

/* REGRAS DE RESPONSIVIDADE */
@media (max-width: 768px) {
    body { padding: 0.5rem; }
    .container { padding: 1rem; }
    header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .view-switcher { width: 100%; justify-content: space-between; }
    .view-switcher button { padding: 0.5rem; font-size: 0.9rem; }
    .inline-form { flex-direction: column; gap: 10px; }
    .inline-form button { width: 100%; }
    .schedule-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .schedule-actions { width: 100%; display: flex; justify-content: space-between; }
    .schedule-actions .action-btn { flex-grow: 1; margin: 0 5px 0 0; }
    .schedule-actions .action-btn:last-child { margin-right: 0; }
    .modal { padding: 0; }
    .modal-content { width: 100%; height: 100%; max-height: none; border-radius: 0; }
    #employee-selection-list { grid-template-columns: 1fr; }
    .vacation-adder { flex-direction: column; align-items: stretch; }
    .vacation-adder button { width: 100%; }
    .initial-state-item { grid-template-columns: 1fr; gap: 5px; align-items: flex-start; }
    .initial-state-item input { width: 100%; }
    #schedule-report-container ul { column-count: 1; }
}

/* ESTILOS DA PÁGINA DE BOAS-VINDAS */
#landing-view {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    text-align: center;
    padding: 1rem;
}
.landing-content {
    max-width: 600px;
    padding: 2.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.landing-content h2 {
    font-size: 2rem;
    color: var(--dark-text-color);
    margin-top: 0;
    margin-bottom: 0.5rem;
}
.landing-content .tagline {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}
.landing-content hr {
    border: 0;
    border-top: 1px solid #ecf0f1;
    margin: 1.5rem 0;
}
.info-box {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin-bottom: 1.5rem;
}
.info-box .example-url {
    font-family: monospace;
    background-color: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: #495057;
    word-break: break-all;
}
.cta-box p {
    margin: 0.5rem 0;
}
.contact-button {
    display: inline-block;
    width: auto;
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background-color: var(--success-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
.contact-button:hover {
    background-color: #229954;
}