/* --- GERAL E LAYOUT COM SIDEBAR --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    color: #333;
    display: flex;
    background-color: #f4f7f6;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background-color: #2c3e50;
    color: #ecf0f1;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Empurra o rodapé para baixo */
    flex-shrink: 0;
}

.main-content {
    flex-grow: 1;
    height: 100%;
    overflow-y: auto;
    padding: 30px;
    box-sizing: border-box;
}

h1, h2 {
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-top: 0;
}

h2 {
    border-bottom: none;
    padding-bottom: 0;
}

p {
    line-height: 1.6;
}

/* --- ESTILOS DA SIDEBAR --- */
.sidebar-header {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #46627f;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 22px;
    color: #fff;
    text-align: center;
}

.company-indicator {
    padding: 10px 15px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}
.company-indicator span {
    display: block;
    margin-bottom: 5px;
    color: #bdc3c7;
}
.company-indicator strong {
    color: #fff;
    display: block;
}
.company-indicator a {
    color: #3498db;
    text-decoration: none;
    font-size: 12px;
}
.company-indicator a:hover {
    text-decoration: underline;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-link {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 15px;
    border-radius: 6px;
    transition: background-color 0.3s, color 0.3s;
}

.nav-link:hover {
    background-color: #34495e;
    color: #fff;
}
.nav-link.active {
    background-color: #3498db;
    color: #fff;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid #46627f;
    font-size: 14px;
    text-align: center;
}
.sidebar-footer span {
    display: block;
    margin-bottom: 10px;
    color: #bdc3c7;
    word-wrap: break-word;
}
.sidebar-footer a {
    color: #e74c3c;
    font-weight: bold;
    text-decoration: none;
}
.sidebar-footer a:hover {
    text-decoration: underline;
}


/* --- FORMULÁRIOS E INPUTS --- */
.form-container {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 200px;
}

label {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
}

/* --- FORMULÁRIO DE EDIÇÃO ESPECÍFICO --- */
.edit-form .form-group {
    width: calc(33.33% - 14px);
}

.full-width {
    width: 100%;
}

fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

legend {
    font-weight: 600;
    color: #3498db;
    padding: 0 10px;
}

.form-actions {
    width: 100%;
    margin-top: 15px;
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

/* --- BOTÕES --- */
.btn, button {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
    text-align: center;
    line-height: 1.5;
}

.btn-primary, button[type="submit"] {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}
.btn-primary:hover, button[type="submit"]:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-save {
    background-color: #27ae60;
    color: white;
    border-color: #27ae60;
}
.btn-save:hover {
    background-color: #229954;
    border-color: #229954;
}

.btn-edit {
    background-color: #f39c12; /* Laranja */
    color: white;
    border-color: #f39c12;
}
.btn-edit:hover {
    background-color: #e67e22; /* Laranja mais escuro */
    border-color: #e67e22;
}

.btn-delete {
    background-color: #e74c3c; /* Vermelho */
    color: white;
    border-color: #e74c3c;
}
.btn-delete:hover {
    background-color: #c0392b; /* Vermelho mais escuro */
    border-color: #c0392b;
}

.btn-cancel {
    background-color: #95a5a6; /* Cinzento */
    color: white;
    margin-left: 10px;
    border-color: #95a5a6;
}
.btn-cancel:hover {
    background-color: #7f8c8d; /* Cinzento mais escuro */
    border-color: #7f8c8d;
}

/* --- TABELAS --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
}

th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    vertical-align: middle;
}

th {
    background-color: #ecf0f1;
    font-weight: 600;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.actions-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.actions-cell form {
    margin: 0;
}


/* --- ALERTAS --- */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: bold;
}
.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- PAGINAÇÃO --- */
.pagination {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a {
    color: #3498db;
    padding: 8px 16px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
}

.pagination a:hover {
    background-color: #f0f0f0;
}

.pagination a.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination a.disabled {
    color: #aaa;
    pointer-events: none;
    background-color: #f9f9f9;
}

.pagination-ellipsis {
    padding: 8px 16px;
    color: #aaa;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
}
