/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --verde: #2e7d32;
  --verde-claro: #4caf50;
  --dorado: #d4af37;
  --dorado-claro: #f9d77e;
  --tierra: #8d6e63;
  --blanco: #ffffff;
  --gris-fondo: #f9f9f9;
  --gris-texto: #424242;
  --sombra: 0 4px 12px rgba(0,0,0,0.1);
  --borde: 1px solid #e0e0e0;
  --redondeo: 12px;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background: var(--gris-fondo);
  color: var(--gris-texto);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
header {
  background: var(--verde);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--sombra);
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

header h1 .coin-icon::before {
  content: "🪙";
  font-size: 1.4em;
}

header p {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Main */
main {
  padding: 2rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Títulos */
h2 {
  color: var(--verde);
  margin-bottom: 1.5rem;
  font-weight: 600;
  font-size: 1.4rem;
  position: relative;
  padding-bottom: 0.5rem;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--dorado);
  border-radius: 3px;
}

/* Formularios */
form {
  background: var(--blanco);
  padding: 1.5rem;
  border-radius: var(--redondeo);
  box-shadow: var(--sombra);
  max-width: 500px;
  margin: 0 auto 2rem auto;
}

label {
  display: block;
  margin: 1rem 0 0.5rem;
  font-weight: 500;
  color: var(--tierra);
}

input, textarea, select, button {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border: var(--borde);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--verde-claro);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

button {
  background: var(--verde);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

button:hover {
  background: #1b5e20;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}

/* Tablas */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--blanco);
  box-shadow: var(--sombra);
  border-radius: var(--redondeo);
  overflow: hidden;
  border: var(--borde);
}

table th {
  background: var(--verde);
  color: white;
  text-align: left;
  padding: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

table th:hover {
  background: #1b5e20;
}

table td {
  padding: 1rem;
  border-bottom: var(--borde);
  position: relative;
}

table tr:last-child td {
  border-bottom: none;
}

table tr:hover {
  background: #f0f7f0;
}

/* Editable */
td[contenteditable] {
  cursor: pointer;
  transition: background 0.2s;
}

td[contenteditable]:hover {
  background: #e8f5e8;
}

/* Nticoins */
.coin {
  color: var(--dorado);
  font-weight: bold;
  font-size: 1.1em;
}

.coin-icon::before {
  content: "🪙";
  margin-right: 4px;
}

/* Saldo */
.saldo-box {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
  padding: 1.8rem;
  border-radius: var(--redondeo);
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: var(--sombra);
  position: relative;
  overflow: hidden;
}

.saldo-box::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 100px;
  height: 100px;
  background: var(--dorado-claro);
  border-radius: 50%;
  opacity: 0.2;
}

.saldo-box h3 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.aprobado {
  color: var(--dorado-claro);
  font-weight: bold;
  font-size: 1.1rem;
}

/* Botones */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--verde-claro);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0.25rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: #388e3c;
  transform: translateY(-2px);
}

.btn-back {
  background: #616161;
}

.btn-back:hover {
  background: #424242;
}

.btn-approve {
  background: #4caf50;
}

.btn-reject {
  background: #f44336;
}

/* Filtros */
.filtros {
  background: white;
  padding: 1.2rem;
  border-radius: var(--redondeo);
  box-shadow: var(--sombra);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
}

.filtros label {
  font-size: 0.9rem;
  color: var(--tierra);
  font-weight: 500;
}

.filtros input, .filtros select {
  width: auto;
  min-width: 180px;
}

/* Barra de búsqueda */
.buscar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.buscar input {
  flex: 1;
  max-width: 300px;
  padding: 0.7rem;
}

/* Paginación */
.paginacion {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.paginacion button {
  padding: 0.6rem 1rem;
  background: white;
  color: var(--verde);
  border: var(--borde);
  border-radius: 8px;
  cursor: pointer;
  min-width: 40px;
}

.paginacion button.active {
  background: var(--verde);
  color: white;
  border-color: transparent;
}

.paginacion button:hover:not(.active) {
  background: #e8f5e8;
}

/* Flash effect (resaltado al editar) */
.flash {
  animation: flash 1.2s ease-in-out;
}

@keyframes flash {
  0%, 100% { background: transparent; }
  50% { background: var(--dorado-claro); }
}

/* Coin Animation */
.coin-float {
  position: fixed;
  top: 20px;
  z-index: 1000;
  font-size: 2.5rem;
  animation: float-up 1.5s ease-out forwards;
  pointer-events: none;
}

@keyframes float-up {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem;
  }

  main {
    padding: 1rem;
  }

  .saldo-box h3 {
    font-size: 1.4rem;
  }

  table {
    font-size: 0.9rem;
  }

  table th, table td {
    padding: 0.7rem;
  }

  .btn {
    display: block;
    margin: 0.5rem auto;
    text-align: center;
    max-width: 200px;
  }

  .filtros {
    flex-direction: column;
    align-items: stretch;
  }
}