/* Estilos gerais */
:root {
  --primary-color: #0056b3;
  --primary-hover: #004080;
  --secondary-color: #f8f9fa;
  --accent-color: #28a745;
  --text-light: #fff;
  --text-dark: #333;
  --border-color: #ddd;
  --error-color: #dc3545;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  background-color: #f8f9fa;
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 86, 179, 0.6);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Cabeçalho */
header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #003b7a 100%);
  color: var(--text-light);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 500;
  display: flex;
  align-items: center;
}

header img {
  height: 50px;
  margin-right: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

header img:hover {
  transform: scale(1.05);
}

/* Container principal */
.container-fluid {
  flex: 1;
}

.app-container {
  display: flex;
  min-height: calc(100vh - 140px);
}

/* Menu Lateral */
.sidebar {
  background: linear-gradient(180deg, var(--primary-color) 0%, #004b9c 100%);
  color: var(--text-light);
  width: 260px;
  transition: var(--transition);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  height: 100%;
  z-index: 900;
}

.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-light);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-menu {
  padding: 1rem 0;
}

.nav-item {
  margin-bottom: 0.5rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  font-weight: 500;
  border-left: 4px solid transparent;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-light);
  background-color: rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent-color);
}

.nav-link i {
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

/* Conteúdo Principal */
.content-wrapper {
  flex: 1;
  padding: 1.5rem;
  margin-left: 260px;
  transition: var(--transition);
}

.page-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--primary-color);
}

/* Cards */
.card {
  background-color: var(--text-light);
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
  background-color: var(--secondary-color);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* Formulários */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-dark);
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 4px;
  transition: var(--transition);
}

.form-control:focus {
  color: #495057;
  background-color: #fff;
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25);
}

.form-select {
  display: block;
  width: 100%;
  padding: 0.75rem 2.25rem 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  appearance: none;
  transition: var(--transition);
}

.form-select:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25);
}

/* Botões */
.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 4px;
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  color: var(--text-light);
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  color: var(--text-light);
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-secondary:hover {
  color: #fff;
  background-color: #5a6268;
  border-color: #545b62;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-warning {
  color: #212529;
  background-color: var(--warning-color);
  border-color: var(--warning-color);
}

.btn-warning:hover {
  color: #212529;
  background-color: #e0a800;
  border-color: #d39e00;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon i {
  margin-right: 0.5rem;
}

/* Tabelas */
.table-container {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.table {
  width: 100%;
  margin-bottom: 1rem;
  background-color: transparent;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  vertical-align: middle;
  border-top: 1px solid var(--border-color);
}

.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid var(--border-color);
  background-color: var(--primary-color);
  color: var(--text-light);
  font-weight: 500;
}

.table tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.03);
}

.table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.075);
}

/* Modais */
.modal-content {
  border-radius: 8px;
  border: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #003b7a 100%);
  color: var(--text-light);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  padding: 1.25rem 1.5rem;
}

.modal-title {
  font-weight: 600;
  font-size: 1.25rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  margin-bottom: 0.75rem;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Alertas e notificações */
.alert {
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  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;
}

.alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeeba;
}

/* Rodapé */
footer {
  background: linear-gradient(135deg, var(--primary-color) 0%, #003b7a 100%);
  color: var(--text-light);
  text-align: center;
  padding: 1rem;
  position: relative;
  width: 100%;
  transition: var(--transition);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 900;
}

footer p {
  margin: 0;
  font-size: 0.9rem;
}

/* Responsividade */
@media (max-width: 992px) {
  .content-wrapper {
    margin-left: 0;
  }
  
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .btn-toggle-sidebar {
    display: block;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.25rem;
  }
  
  header img {
    height: 40px;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .card-body {
    padding: 1.25rem;
  }
  
  .btn {
    padding: 0.625rem 1.25rem;
  }
}

@media (max-width: 576px) {
  .content-wrapper {
    padding: 1rem;
  }
  
  header h1 {
    font-size: 1rem;
  }
  
  header img {
    height: 30px;
    margin-right: 0.5rem;
  }
  
  .page-title {
    font-size: 1.25rem;
  }
  
  .card-header, .card-body {
    padding: 1rem;
  }
  
  .modal-body, .modal-header, .modal-footer {
    padding: 1rem;
  }
  
  .form-control, .form-select {
    padding: 0.625rem 0.875rem;
  }
  
  .sidebar {
    width: 230px;
  }
}

/* Extras e utilitários */
.loading-spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.text-danger {
  color: var(--error-color);
}

.text-success {
  color: var(--success-color);
}

.text-warning {
  color: var(--warning-color);
}

.d-none {
  display: none;
}

.d-flex {
  display: flex;
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-center {
  align-items: center;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 1rem;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

.mb-5 {
  margin-bottom: 3rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 1rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.ml-2 {
  margin-left: 0.5rem;
}

.mr-2 {
  margin-right: 0.5rem;
}

.p-0 {
  padding: 0;
}

.p-3 {
  padding: 1rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-3 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.w-100 {
  width: 100%;
}

.rounded {
  border-radius: 4px;
}

.bg-light {
  background-color: var(--secondary-color);
}