/* Tema Visual pixelemfoco - Nova Paleta */
:root {
  /* Paleta Modo Claro */
  --bg-body: #F4F6F8;
  --bg-header: #FFFFFF;
  --text-primary: #1C1E21;
  --text-secondary: #4E5D6C;
  --btn-primary: #C8943B;
  --btn-hover: #C8943B;
  --link-color: #4A4A4A;
  --border-color: #D0D7DE;
  --highlight: #7E57C2;
  --shadow-sm: 0 2px 8px rgba(28, 30, 33, 0.1);
  --shadow-hover: 0 4px 12px rgba(28, 30, 33, 0.15);
  
  /* Cores legado (compatibilidade) */
  --cor-header: var(--btn-primary);
  --cor-botao: var(--btn-primary);
  --cor-botao-hover: var(--btn-hover);
  --cor-borda: var(--border-color);
  --cor-letra: var(--text-primary);
  --cor-fundo: var(--bg-body);
  --cor-fundo-claro: var(--bg-header);
  --cor-letra-escura: var(--text-primary);
  --cor-card: var(--bg-header);
}

[data-theme="dark"] {
  --bg-body: #0D1117;
  --bg-header: #161B22;
  --text-primary: #E6EDF3;
  --text-secondary: #8B949E;
  --border-color: #30363D;
  --highlight: #9B6BFF;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4);
  
  --cor-letra: #E6EDF3;
  --cor-fundo: #0D1117;
  --cor-fundo-claro: #161B22;
  --cor-card: #161B22;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--cor-fundo);
  color: var(--cor-letra);
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

/* Header */
header {
  background: var(--cor-header);
  color: #FFFFFF;
  padding: 20px 0;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  transition: all 0.3s ease;
}

header img {
  vertical-align: middle;
  margin-right: 12px;
  border-radius: 8px;
}

header .logo-text {
  font-size: 2.2em;
  font-weight: bold;
  vertical-align: middle;
  letter-spacing: 1px;
}

header .logo-text .brand {
  color: var(--cor-botao);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Navegação */
nav {
  background: var(--cor-card);
  border-bottom: 3px solid var(--cor-borda);
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}

nav ul li {
  margin: 0;
}

nav ul li a {
  color: var(--cor-letra);
  text-decoration: none;
  font-weight: bold;
  padding: 14px 24px;
  display: block;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  border-radius: 8px 8px 0 0;
}

nav ul li a:hover,
nav ul li a.active {
  background: var(--highlight);
  color: #FFFFFF;
  border-bottom-color: var(--btn-primary);
  transform: translateY(-2px);
}

/* Container Principal */
main {
  flex: 1;
  padding: 30px 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.intro {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.2em;
  color: var(--cor-letra);
}

/* Tabelas */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--cor-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin: 20px 0;
}

table th,
table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--cor-borda);
}

table th {
  background: var(--cor-header);
  color: var(--cor-letra);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9em;
  letter-spacing: 0.5px;
}

table tr:hover {
  background: rgba(255, 128, 9, 0.1);
}

table img {
  border-radius: 8px;
  border: 2px solid var(--cor-borda);
}

table a {
  color: var(--cor-botao);
  font-weight: bold;
  text-decoration: none;
  transition: color 0.3s;
}

table a:hover {
  color: var(--cor-botao-hover);
  text-decoration: underline;
}

/* Botões */
.btn,
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  background: var(--cor-botao);
  color: var(--cor-fundo);
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  font-size: 1em;
}

.btn:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover {
  background: var(--cor-botao-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  background: var(--cor-borda);
}

.btn-danger {
  background: #dc3545;
}

.btn-small {
  padding: 6px 14px;
  font-size: 0.9em;
}

/* Formulários */
.form-container {
  background: var(--cor-card);
  padding: 30px;
  border-radius: 12px;
  max-width: 600px;
  margin: 20px auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 2px solid var(--cor-borda);
}

fieldset {
  border: 2px solid var(--cor-borda);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

legend {
  color: var(--cor-botao);
  font-weight: bold;
  font-size: 1.2em;
  padding: 0 10px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--cor-letra);
  font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 2px solid var(--cor-borda);
  border-radius: 6px;
  background: var(--cor-fundo-claro);
  color: var(--cor-letra-escura);
  font-size: 1em;
  margin-bottom: 16px;
  transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--cor-botao);
  box-shadow: 0 0 8px rgba(255, 128, 9, 0.3);
}

/* Alertas */
.alert {
  padding: 14px 20px;
  border-radius: 8px;
  margin: 20px 0;
  font-weight: bold;
  text-align: center;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 2px solid #28a745;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 2px solid #dc3545;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 2px solid #ffc107;
}

/* Cards */
.card {
  background: var(--cor-card);
  border: 2px solid var(--cor-borda);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--cor-borda);
}

.card-header h2 {
  color: var(--cor-botao);
  margin: 0;
}

/* Footer */
footer {
  background: var(--cor-header);
  color: var(--cor-letra);
  text-align: center;
  padding: 20px;
  border-top: 3px solid var(--cor-borda);
  margin-top: auto;
}

/* Login Box */
.login-box {
  max-width: 400px;
  margin: 80px auto;
  background: var(--cor-card);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border: 2px solid var(--cor-borda);
}

.login-box h2 {
  color: var(--cor-botao);
  text-align: center;
  margin-bottom: 30px;
}

/* Responsivo */
@media (max-width: 768px) {
  header .logo-text {
    font-size: 1.5em;
  }

  nav ul {
    flex-direction: column;
  }

  nav ul li a {
    border-bottom: 1px solid var(--cor-borda);
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  table tr {
    margin-bottom: 15px;
    border: 2px solid var(--cor-borda);
    border-radius: 8px;
    overflow: hidden;
  }

  table td {
    text-align: right;
    padding-left: 50%;
    position: relative;
  }

  table td::before {
    content: attr(data-label);
    position: absolute;
    left: 6px;
    width: 45%;
    padding-right: 10px;
    text-align: left;
    font-weight: bold;
    color: var(--cor-botao);
  }

  .form-container {
    padding: 20px;
  }
}

/* Utilitários */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.no-data {
  text-align: center;
  padding: 40px;
  font-size: 1.2em;
  color: var(--cor-letra);
  opacity: 0.7;
}

/* Paginação */
.pagination {
  display: inline-flex;
  gap: 6px;
  background: var(--cor-card);
  padding: 10px 14px;
  border: 2px solid var(--cor-borda);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.page-link {
  background: var(--cor-botao);
  color: var(--cor-fundo);
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  min-width: 36px;
  text-align: center;
  transition: .3s;
  font-size: .9em;
}
.page-link:hover { background: var(--cor-botao-hover); transform: translateY(-2px); }
.page-link.active { background: var(--cor-borda); color: #022; box-shadow: 0 0 0 2px var(--cor-borda) inset; }
.page-link.disabled { opacity: .4; pointer-events: none; }
.page-ellipsis { display: flex; align-items: center; color: var(--cor-letra); padding: 0 4px; }

@media (max-width: 480px) {
  .pagination { flex-wrap: wrap; justify-content: center; }
  .page-link { padding: 6px 10px; }
}
