* Reset e configurações globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: #f4f6f8;
    color: #333;
    line-height: 1.6;
}

/* Links */
a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover {
    color: #2563eb; /* azul moderno */
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .logo h2 {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Navbar */
.navbar {
    display: flex;
    gap: 1.5rem;
}

.navbar a {
    color: #fff;
    font-weight: 500;
    position: relative;
    padding-bottom: 3px;
}

.navbar a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: #facc15; /* amarelo destaque */
    transition: width 0.3s ease;
}

.navbar a:hover::after {
    width: 100%;
}

/* Content */
.content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    min-height: 70vh;
}

/* Títulos dentro do conteúdo */
.content h1, 
.content h2 {
    margin-bottom: 1rem;
    font-weight: 600;
    color: #1e3a8a;
}

/* Wrapper para tabelas responsivas */
.responsive-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* rolagem suave no mobile */
    border-radius: 8px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}

/* Tabelas */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
    border: 1px solid #e5e7eb;
    min-width: 600px; /* garante rolagem quando necessário */
}

table th, 
table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid #e5e7eb;
}

table th {
    background: #1e3a8a;
    color: #fff;
    font-weight: 600;
}

table tr:nth-child(even) {
    background: #f9fafb; /* efeito zebra */
}

table tr:hover {
    background: #e0f2fe; /* azul clarinho ao passar o mouse */
}

/* Rodapé */
.footer {
    background: #1e293b;
    color: #cbd5e1;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
}

/* Botões genéricos */
.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn:hover {
    background: #1e40af;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}

/* Responsividade */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .navbar {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .content {
        padding: 1rem;
        margin: 1rem;
    }

    table th, 
    table td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}

/* Header moderno */
.header {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid #facc15; /* detalhe elegante */
}

/* Título do header */
.header-heading {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #facc15, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; /* efeito degradê no texto */
}

/* Links do header */
.header-link {
    color: #f9fafb;
    font-weight: 500;
    margin-left: 1.5rem;
    position: relative;
    transition: color 0.3s ease, transform 0.2s ease;
}

.header-link:hover {
    color: #facc15;
    transform: translateY(-2px); /* leve animação */
}

.header-link::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background: #facc15;
    transition: width 0.3s ease;
}

.header-link:hover::after {
    width: 100%;
}

/* Menu container */
.menu {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

/* Lista de links do menu */
.menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Links do menu */
.menu-link {
    color: #1e3a8a;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: block;
}

.menu-link:hover {
    background: #e0f2fe; /* azul claro suave */
    color: #1e40af;
    transform: translateX(5px); /* leve movimento */
}

/* Container de busca */
.search {
  position: relative;
  width: 100%;
  max-width: 500px; /* aumentei um pouco */
  margin: 1.5rem auto;
}

/* Input da busca */
.search input[type="search"] {
  width: 100%;
  padding: 16px 48px 16px 20px; /* mais espaçamento */
  border: 2px solid #d1d5db;
  border-radius: 12px; /* mais quadradinho, moderno */
  font-size: 16px; /* maior */
  background-color: #fff;
  color: #111827;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08); /* destaque sutil */
}

/* Foco no input */
.search input[type="search"]:focus {
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35); /* destaque mais forte */
  background-color: #f9fafb;
}

/* Ícone de busca */
.search::before {
  content: "🔍";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #6b7280;
  pointer-events: none;
  transition: color 0.3s ease;
}

/* Ícone muda com foco */
.search:focus-within::before {
  color: #2563eb;
}

/* Placeholder mais elegante */
.search input[type="search"]::placeholder {
  color: #9ca3af;
  font-style: italic;
  font-size: 15px;
}

/* Paginação moderna */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0 1rem;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #1e3a8a;
  font-weight: 500;
  transition: all 0.3s ease;
  min-width: 40px;
  text-align: center;
}

.pagination a:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.pagination .current {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  font-weight: 600;
  cursor: default;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

/* Responsividade */
@media (max-width: 600px) {
  .pagination {
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .pagination a,
  .pagination span {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
}

/* Área geral do formulário */
.form-content {
    max-width: 600px;              /* largura máxima */
    margin: 0 auto;                /* centralizar na tela */
    padding: 2rem;
    background: #ffffff;           /* fundo branco clean */
    border: 1px solid #e0e0e0;     /* borda leve */
    border-radius: 12px;           /* cantos arredondados */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* sombra suave */
    font-family: "Segoe UI", Roboto, sans-serif;
}

/* Cada grupo de campo (label + input) */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.2rem;
}

/* Layout da seção de permissões */
.permissions-section {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 2rem;
    align-items: flex-start;
}

.all-permissions {
    text-align: left;
}

.user-permissions {
    text-align: right;
}

.permissions-section select {
    width: 100%;
    height: 320px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 0.95rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    transition: border 0.2s, box-shadow 0.2s;
}

.permissions-section select:focus {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0,123,255,0.3);
    outline: none;
}

.permissions-section h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Botões centrais de permissões */
.permission-buttons {
    flex: 0 0 180px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
    justify-content: center;
}

.permission-buttons button {
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #4a90e2, #007bff);
    color: #fff;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
}

.permission-buttons button:hover {
    background: linear-gradient(135deg, #3578c5, #0056b3);
    transform: translateY(-1px);
}

/* Botões principais Salvar e Voltar */
.btn-primary, .btn-back {
    margin-top: 2rem;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
    font-weight: 600;
}

.btn-back {
    background-color: #6c757d;
    color: #fff;
    margin-right: 1rem;
}

.btn-back:hover {
    background-color: #5a6268;
}

/* Container para os botões Salvar e Voltar */
.form-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 2rem;
    gap: 1rem;
}

/* Label do campo */
.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.4rem;
}

/* Input, Select, Textarea */
.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.6rem 0.9rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    background: #fafafa;
    transition: all 0.2s ease-in-out;
}

/* Efeito ao focar */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #4a90e2;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74,144,226,0.2);
}

/* Botões */
.form-content button {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 0.8rem 1.4rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
}

/* Hover no botão */
.form-content button:hover {
    background: #357ABD;
}

/* Mensagens de feedback */
.message {
    padding: 12px 18px;
    margin: 12px 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.4s ease-in-out;
}

/* Sucesso */
.message.success {
    background: #e6f9f0;
    border: 1px solid #2ecc71;
    color: #2ecc71;
}

/* Erro */
.message.error {
    background: #fdecea;
    border: 1px solid #e74c3c;
    color: #e74c3c;
}

/* Aviso */
.message.warning {
    background: #fff8e6;
    border: 1px solid #f1c40f;
    color: #f39c12;
}

/* Ícones opcionais dentro das mensagens */
.message i {
    font-size: 18px;
}

/* Animação */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Container dos botões */
.action-buttons {
    margin-top: 30px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* responsivo para mobile */
}

/* Container dos botões da detail page */
.detail-action-buttons {
    margin-top: 30px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Botão base da detail page */
.detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.9rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    min-width: 140px;
    text-align: center;
}

/* Editar - Azul vibrante */
.detail-btn.edit {
    background: #3b82f6;
}

.detail-btn.edit:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59,130,246,0.3);
}

/* Voltar - Cinza elegante */
.detail-btn.back {
    background: #6b7280;
}

.detail-btn.back:hover {
    background: #4b5563;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(107,114,128,0.3);
}

/* Deletar - Vermelho intenso */
.detail-btn.delete {
    background: #ef4444;
}

.detail-btn.delete:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(239,68,68,0.3);
}

/* Cabeçalho */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: #1f2937; /* cinza escuro */
    color: white;
}

.logo h2 {
    margin: 0;
}

/* Botão de Logout */
.logout-link {
    padding: 8px 16px;
    background: #ef4444; /* vermelho elegante */
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.logout-link:hover {
    background: #dc2626; /* tom mais escuro no hover */
}

/* Mensagens */
.messages {
    margin: 20px 0;
}

.message {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

.message.info {
    background: #e0f2fe;
    color: #1e3a8a;
}

/* Conteúdo principal */
.content {
    padding: 20px;
}

/* Rodapé */
.footer {
    text-align: center;
    padding: 15px;
    background: #f3f4f6;
    color: #374151;
}


/* Dashboard container */
.dashboard {
    text-align: center;
}

.intro-text {
    color: #555;
    margin-bottom: 2rem;
}

/* Seções do dashboard */
.dashboard-section {
    margin-bottom: 3rem;
    text-align: left;
}

.dashboard-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: #1e3a8a;
    border-left: 5px solid #2563eb;
    padding-left: 10px;
}

/* Grid de cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    color: #1f2937;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
    background: #f9fafb;
}

/* Ícone do card */
.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Título do card */
.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2563eb;
}

/* Descrição */
.card-desc {
    font-size: 0.95rem;
    color: #555;
}

.main-header {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: #2c3e50; /* azul escuro elegante */
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.home-link {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    transition: 0.3s;
}

.home-link:hover {
    color: #1abc9c; /* verde água no hover */
}

.home-icon {
    font-size: 22px;
    margin-right: 8px;
}

/* Botão Home */
.home-button {
    font-size: 20px;
    text-decoration: none;
    color: #fff;
    background: #2563eb;
    padding: 8px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px; /* espaço entre o ícone e o texto */
    font-weight: bold;
    transition: background 0.3s;
}

.home-button:hover {
    background: #1d4ed8;
}

.home-button span {
    color: #fff;  /* garante que o texto fique branco */
    font-size: 16px;
}

/* Saudações no header */
.saudacao-container {
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.saudacao-text {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

/* Estilos para filtros compactos */
.compact-filters {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid #e9ecef;
}

.filter-form-compact {
  width: 100%;
}

.filter-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-input, .filter-select {
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.9rem;
}

.filter-input {
  flex: 1;
  min-width: 120px;
}

.filter-select {
  min-width: 140px;
}

.btn-compact {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Estilos para as abas de visualização */
.view-tabs {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  margin: 1.5rem 0 1rem;
  background: #fff;
  border-radius: 8px 8px 0 0;
  padding: 0.5rem;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  color: #666;
  border-radius: 4px;
  margin: 0 0.25rem;
}

.tab-btn.active {
  color: #007bff;
  border-bottom-color: #007bff;
  background-color: #f8f9fa;
  font-weight: 600;
}

.tab-btn:hover:not(.active) {
  background-color: #f0f0f0;
  color: #333;
}

.view-content {
  display: none;
  animation: fadeIn 0.3s ease-in;
}

.view-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

