@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css');

/* --- Estilos Globais --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #f4f7f6;
    display: flex;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Menu Lateral (Sidebar) --- */
.sidebar {
    width: 240px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    box-sizing: border-box;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}
.sidebar-header {
    text-align: center;
    padding: 15px 10px;
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 8px;
}
.sidebar-header img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* --- Informações do Usuário na Sidebar --- */
.sidebar .user-profile {
    padding: 15px 10px;
    text-align: center;
    border-bottom: 1px solid #34495e;
    margin-bottom: 15px;
}
.sidebar .user-profile .user-name {
    color: #ecf0f1;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}
.sidebar .user-profile .user-role {
    font-size: 0.85em;
    color: #bdc3c7;
}
.user-profile .logout-link {
    display: inline-block;
    margin-left: 10px;
    color: #bdc3c7;
    font-size: 0.8em;
    text-decoration: none;
    vertical-align: middle;
}
.user-profile .logout-link:hover {
    color: #e74c3c;
    text-decoration: underline;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar nav a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #ecf0f1;
    border-radius: 6px;
    transition: background-color 0.2s ease-in-out, color 0.2s;
    font-weight: 500;
}

/* --- Estilos do Menu Sanfona --- */
.sidebar nav .menu-item-group {
    margin-top: 15px;
}
.sidebar nav .menu-group-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    width: 100%;
    border: none;
    font-size: 1em;
    cursor: pointer;
    font-family: inherit;
    padding: 12px 15px;
    color: #ecf0f1;
    font-weight: 500;
}
.sidebar nav .menu-group-toggle .arrow { transition: transform 0.3s ease; }
.sidebar nav .menu-group-toggle.active .arrow { transform: rotate(180deg); }
.sidebar nav .submenu {
    list-style: none;
    padding-left: 15px; /* Indentação para sub-itens */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}
.sidebar nav .submenu a {
    color: #bdc3c7; /* Cor mais suave para sub-itens */
    font-size: 0.95em;
}
.sidebar nav .submenu a.active { color: #ffffff; }
.sidebar nav a:hover, .sidebar nav .menu-group-toggle:hover {
    background-color: #34495e; /* Azul um pouco mais claro */
    color: #ffffff;
}
.sidebar nav a.active, .sidebar nav .menu-group-toggle.active { /* Classe para item ativo */
    background-color: #3498db; /* Azul de destaque */
    color: #ffffff;
    font-weight: bold;
}

/* --- Área de Conteúdo Principal --- */
.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    height: 100vh;
    box-sizing: border-box;
}
.main-content header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 15px;
    margin-bottom: 25px;
}
.main-content header h1 {
    margin: 0;
    font-size: 2em;
    color: #2c3e50;
    font-weight: 700;
}

/* --- Alertas --- */
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }
.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.close-btn { float: right; font-size: 20px; font-weight: bold; cursor: pointer; line-height: 1; }

/* --- Estilos de Tabela --- */
.table-container { background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; box-shadow: 0 4px 8px rgba(0,0,0,0.05); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #ddd; }
th { background-color: #f2f2f2; font-weight: 600; color: #34495e; }
tr:hover { background-color: #f9f9f9; }
.actions a { color: #3498db; margin-right: 15px; text-decoration: none; font-size: 16px; }
.actions a.delete { color: #e74c3c; }
.actions a:hover, .actions .delete-btn:hover { opacity: 0.7; }
.actions .delete-btn { background: none; border: none; color: #e74c3c; cursor: pointer; padding: 0; font-size: 16px; }

/* --- Estilos de Formulário --- */
.form-container { background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 30px; max-width: 700px; margin: 0 auto; box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #34495e; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; font-size: 1em; }
.form-group small { display: block; margin-top: 5px; color: #7f8c8d; font-size: 0.85em; }
.form-actions { margin-top: 30px; text-align: right; }
.btn-submit { background-color: #3498db; color: white; padding: 12px 25px; border: none; border-radius: 5px; font-size: 1em; font-weight: bold; cursor: pointer; transition: background-color 0.3s; }
.btn-submit:hover { background-color: #2980b9; }

/* --- Botões --- */
.btn-novo { background-color: #27ae60; color: white; padding: 10px 20px; text-decoration: none; border-radius: 5px; font-weight: bold; transition: background-color 0.3s; }
.btn-novo:hover { background-color: #229954; }

/* --- Busca --- */
.search-container { margin-bottom: 25px; background-color: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 15px; }
.search-container input[type="search"] { flex-grow: 1; padding: 10px 15px; border: 1px solid #ccc; border-radius: 5px; font-size: 1em; }
.search-container button, .search-container a { padding: 10px 20px; border-radius: 5px; border: none; font-weight: bold; cursor: pointer; text-decoration: none; white-space: nowrap; }