/* Variáveis de cores */
:root {
  /* Tema Claro */
  --primaria: #1b3e8f;
  --secundaria: #e40033;
  --fundo: #FFFFFF;
  --texto-principal: #333333;
  --texto-secundario: #666666;
  --borda-acento: #4b6cbf;

  /* Tema Escuro */
  --primaria-escura: #142f6b;
  --secundaria-escura: #b30029;
  --fundo-escuro: #1a1a1a;
  --texto-principal-escuro: #FFFFFF;
  --texto-secundario-escuro: #cccccc;
  --borda-acento-escura: #3a5499;
}

/* Estilos Gerais */
body {
  font-family: 'Roboto', Arial, sans-serif;
  color: var(--texto-principal);
  background-color: #f8f9fa;
  line-height: 1.6;
}

a {
  color: var(--primaria);
  text-decoration: none;
}

a:hover {
  color: var(--borda-acento);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--primaria);
}

/* Container para centralizar o conteúdo */
.container-main {
  max-width: 1200px;
  padding: 20px;
  margin: 0 auto;
}

/* Navbar */
.navbar {
  background-color: var(--primaria);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 700;
  color: var(--fundo) !important;
}

.navbar-nav .nav-link {
  color: var(--fundo) !important;
  font-weight: 500;
}

.navbar-nav .nav-link:hover {
  color: rgba(255, 255, 255, 0.85) !important;
}

.navbar-nav .nav-item.active .nav-link {
  color: var(--secundaria) !important;
}

.logo-container {
  background-color: #FFFFFF;
  padding: 5px;
  border-radius: 4px;
}

.logo-container img {
  height: 40px;
}

/* Cards */
.card {
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 20px;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
  background-color: var(--primaria);
  color: var(--fundo) !important;
  border-radius: 7px 7px 0 0 !important;
  font-weight: 600;
}

.card-header h5, .card-header h6 {
  color: var(--fundo) !important;
  font-weight: 600;
}

.card-header-secondary {
  background-color: var(--secundaria);
  color: var(--fundo);
}

/* Botões */
.btn-primary {
  background-color: var(--primaria);
  border-color: var(--primaria);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primaria-escura);
  border-color: var(--primaria-escura);
}

.btn-secondary {
  background-color: var(--secundaria);
  border-color: var(--secundaria);
}

.btn-secondary:hover, .btn-secondary:focus {
  background-color: var(--secundaria-escura);
  border-color: var(--secundaria-escura);
}

.btn-outline-primary {
  color: var(--primaria);
  border-color: var(--primaria);
}

.btn-outline-primary:hover {
  background-color: var(--primaria);
  color: white;
}

/* Tabelas */
.table {
  width: 100%;
  margin-bottom: 1rem;
  color: var(--texto-principal);
  border-radius: 8px;
  overflow: hidden;
  table-layout: fixed;
}

/* Controle de largura das colunas */
.table td, .table th {
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding: 8px 12px;
  vertical-align: middle;
}

/* Larguras específicas para colunas comuns */
.table .col-descricao {
  width: 40%;
}

.table .col-item-sap {
  width: 20%;
  min-width: 120px;
}

.table .col-tipo {
  width: 25%;
}

.table .col-acoes {
  width: 15%;
  min-width: 100px;
  text-align: center;
}

/* Truncar texto muito longo com reticências */
.table .text-truncate {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table thead th {
  background-color: var(--primaria) !important;
  color: white !important;
  border-bottom: 2px solid var(--primaria-escura);
  font-weight: 600;
}

/* Força cor branca para texto de cabeçalhos de tabela */
.table thead th,
.table thead th a,
.table thead th span,
.table thead th i {
  color: white !important;
}

/* Estilos específicos para diferentes tipos de tabela */
.table-dark thead th {
  background-color: #343a40 !important;
  color: white !important;
}

.table-primary thead th {
  background-color: var(--primaria) !important;
  color: white !important;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
  background-color: rgba(75, 108, 191, 0.1);
}

/* Badges */
.badge-primary {
  background-color: var(--primaria);
}

.badge-secondary {
  background-color: var(--secundaria);
}

.badge-success {
  background-color: #28a745;
}

.badge-danger {
  background-color: #dc3545;
}

.badge-warning {
  background-color: #ffc107;
  color: #2c3e50;
  font-weight: 600;
}

.badge-info {
  background-color: #17a2b8;
}

/* Formulários */
.form-control:focus {
  border-color: var(--borda-acento);
  box-shadow: 0 0 0 0.2rem rgba(75, 108, 191, 0.25);
}

.form-group label {
  font-weight: 500;
  color: var(--primaria);
}

/* Alertas */
.alert {
  border-radius: 8px;
  font-weight: 500;
}

.alert-primary {
  background-color: rgba(27, 62, 143, 0.15);
  border-color: rgba(27, 62, 143, 0.2);
  color: var(--primaria);
}

.alert-secondary {
  background-color: rgba(228, 0, 51, 0.15);
  border-color: rgba(228, 0, 51, 0.2);
  color: var(--secundaria);
}

/* Tela de Login */
.login-container {
  max-width: 400px;
  margin: 50px auto;
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.login-form {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.login-title {
  text-align: center;
  margin-bottom: 20px;
  color: var(--primaria);
}

.login-subtitle {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: var(--texto-secundario);
}

.login-disclaimer {
  text-align: center;
  font-size: 0.8rem;
  margin-top: 20px;
  color: var(--texto-secundario);
}

/* Dashboard */
.dashboard-card {
  text-align: center;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dashboard-card .card-title {
  font-size: 1rem;
  font-weight: 600;
}

.dashboard-card .card-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primaria);
}

/* Ícones */
.icon-action {
  margin-right: 5px;
  cursor: pointer;
}

.icon-edit {
  color: var(--primaria);
}

.icon-delete {
  color: var(--secundaria);
}

.icon-view {
  color: #17a2b8;
}

/* Tabela de irradiação/consumo */
.table-month {
  width: 100%;
  border-collapse: collapse;
}

.table-month th, .table-month td {
  padding: 8px;
  text-align: center;
  border: 1px solid #ddd;
}

.table-month th {
  background-color: var(--primaria);
  color: white;
}

/* Unidade geradora */
.unidade-geradora {
  background-color: rgba(255, 193, 7, 0.2);
  position: relative;
  color: #2c3e50 !important;
}

.unidade-geradora h5,
.unidade-geradora .card-header h5,
.card-header.bg-warning h5,
.card-header.bg-warning .mb-0 {
  color: #2c3e50 !important;
  font-weight: 600;
}

.bg-warning.bg-opacity-25 h5,
.bg-warning.bg-opacity-25 .mb-0 {
  color: #2c3e50 !important;
  font-weight: 600;
}

.unidade-geradora::after {
  content: '⚡';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2em;
  color: #e67e22;
}

/* Badge de aprovação */
.aprovado-badge {
  background-color: #28a745;
  padding: 3px 8px;
  color: white;
  border-radius: 4px;
  font-size: 0.8em;
}

.pendente-badge {
  background-color: #ffc107;
  padding: 3px 8px;
  color: #212529;
  border-radius: 4px;
  font-size: 0.8em;
}

/* Anexos */
.anexo-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 8px;
}

.anexo-icon {
  margin-right: 10px;
  font-size: 1.2em;
  color: var(--primaria);
}

.anexo-nome {
  flex-grow: 1;
}

.anexo-acoes {
  display: flex;
  gap: 5px;
}

/* Histórico */
.historico-item {
  margin-bottom: 15px;
  padding: 10px;
  border-left: 3px solid var(--primaria);
  background-color: #f8f9fa;
}

.historico-tempo {
  font-size: 0.85em;
  color: var(--texto-secundario);
}

.historico-usuario {
  font-weight: 600;
  color: var(--primaria);
}

.historico-acao {
  font-weight: 500;
}

.historico-acao.criacao {
  color: #28a745;
}

.historico-acao.edicao {
  color: #fd7e14;
}

.historico-acao.exclusao {
  color: #dc3545;
}

.historico-acao.aprovacao {
  color: #17a2b8;
}

.historico-detalhe {
  margin-top: 5px;
  font-size: 0.9em;
}

/* Catálogos */
.catalogo-padrao {
  background-color: rgba(40, 167, 69, 0.1);
}



/* Responsivo */
@media (max-width: 768px) {
  .login-container {
    margin: 20px;
    max-width: 100%;
  }

  .dashboard-card .card-number {
    font-size: 2rem;
  }

  .table-responsive {
    overflow-x: auto;
  }
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.btn-sm.btn-outline-primary,
.btn-sm.btn-outline-secondary,
.btn-sm.btn-outline-danger {
  background-color: rgba(255, 255, 255, 0.95);
  border-width: 1.5px;
}

/* Melhorar contraste em elementos com fundo amarelo */
.table-warning {
  color: #2c3e50 !important;
}

.table-warning td {
  color: #2c3e50 !important;
  font-weight: 500;
}