/* ==========================================================================
   Club Quinta Essenza - CSS de Panel de Administración (Cajero)
   Estilo de Punto de Venta (High-Contrast, Navy, Dark Grey & Accents)
   ========================================================================== */

:root {
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  
  --cream: #f7f6f2;
  --ink: #1c1a17;
  --ink-soft: rgba(28, 26, 23, 0.6);
  --line: rgba(28, 26, 23, 0.14);
  
  --navy: #0c2038;
  --gold: #b8974f;
  --green: #27ae60;
  --red: #c0392b;
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2.5rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: relative;
  z-index: 10;
}

.site-logo {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 2.2rem;
}

.site-nav a {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--ink);
}

@media (max-width: 650px) {
  .site-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1.2rem 1rem;
    align-items: center;
    text-align: center;
  }

  .site-nav {
    gap: 1.2rem;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
  }
}

.site-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: auto;
  background: #fff;
}

/* ---------- Main Layout ---------- */

.admin-main {
  flex: 1;
  padding: 3rem 1.5rem;
  position: relative;
}

.admin-grain {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}

.admin-container {
  max-width: 1040px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.terminal-header {
  border-bottom: 2px solid var(--line);
  padding-bottom: 1.5rem;
}

.terminal-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.1rem;
  color: var(--navy);
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

.terminal-header p {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.badge {
  background: var(--navy);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  display: inline-block;
}

/* Grid Layout */

.terminal-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
}

.panel-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.03);
}

.panel-box h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.panel-desc {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

/* ---------- Visor del Escáner (html5-qrcode) ---------- */

.scanner-wrapper {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
}

#reader {
  width: 100% !important;
  border: none !important;
  background: #000;
}

/* Estilar botones internos de html5-qrcode para que se vean premium */
#reader button {
  background: var(--navy) !important;
  color: #fff !important;
  border: none !important;
  padding: 0.6rem 1.2rem !important;
  border-radius: 6px !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  margin: 0.5rem !important;
  transition: all 0.2s ease !important;
}

#reader button:hover {
  background: var(--gold) !important;
}

#reader select {
  padding: 0.5rem !important;
  border-radius: 4px !important;
  border: 1px solid var(--line) !important;
  font-family: inherit !important;
  font-size: 0.8rem !important;
  margin: 0.5rem !important;
}

/* Entrada Manual */

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 2rem 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1.5px solid var(--line);
}

.divider span {
  padding: 0 1rem;
}

.manual-input-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.manual-input-box label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.input-action-row {
  display: flex;
  gap: 0.5rem;
}

.input-action-row input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--cream);
  color: var(--ink);
}

.btn-secondary {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-secondary:hover {
  opacity: 0.9;
}

.quick-select-box {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.quick-select-box select {
  padding: 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 0.82rem;
  background: var(--cream);
}

/* ---------- Sección Derecha: Detalle de Socio ---------- */

.client-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--ink-soft);
  gap: 1rem;
}

.wait-icon {
  font-size: 3rem;
  animation: pulse 2s infinite ease-in-out;
}

.client-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.4s ease both;
}

.client-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.avatar {
  font-size: 2.2rem;
  background: var(--cream);
  border: 1.5px solid var(--line);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.client-card-header h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--navy);
}

.client-card-header p {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
}

.client-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-item {
  background: var(--cream);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.04);
}

.stat-item .label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 0.25rem;
}

.stat-item .val {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
}

/* Formulario de puntos */

.points-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.points-form .input-group label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
}

.currency-input {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--navy);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.currency-input .symbol {
  padding: 0.75rem 1rem;
  background: var(--cream);
  font-weight: 700;
  color: var(--navy);
  border-right: 1.5px solid var(--navy);
}

.currency-input input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}

.currency-input input:focus {
  outline: none;
}

.points-calc-box {
  background: #f1f8e9;
  border: 1px solid #c8e6c9;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  color: #2e7d32;
}

.points-calc-box p {
  font-size: 0.78rem;
  font-weight: 600;
}

.points-calc-box h4 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 0.2rem;
}

.btn-success {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.2);
}

.btn-success:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.hidden {
  display: none !important;
}

/* ---------- Historial de Operaciones ---------- */

.history-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.03);
}

.history-panel h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: 1.25rem;
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 0.75rem;
}

.history-table-wrapper {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.history-table th {
  padding: 0.8rem 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--line);
}

.history-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

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

.history-table .empty-msg {
  text-align: center;
  padding: 2.5rem;
  color: var(--ink-soft);
  font-style: italic;
}

.history-table .points-add {
  color: var(--green);
  font-weight: 700;
}

.history-table .status-success {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Keyframes */

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.7; }
}

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

/* Responsividad */

@media (max-width: 900px) {
  .terminal-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ==========================================================================
   Estilos de Validación de Reseñas (Cajero/Admin)
   ========================================================================== */

.img-thumbnail {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  display: block;
}

.img-thumbnail:hover {
  transform: scale(1.1);
  border-color: var(--gold);
}

.btn-action-approve {
  background: var(--green);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s ease;
  margin-right: 0.5rem;
  box-shadow: 0 2px 5px rgba(39, 174, 96, 0.15);
}

.btn-action-reject {
  background: var(--red);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s ease;
  box-shadow: 0 2px 5px rgba(192, 57, 43, 0.15);
}

.btn-action-approve:hover,
.btn-action-reject:hover {
  opacity: 0.9;
}

/* Lightbox Modal */
.admin-modal-overlay {
  position: fixed;
  z-index: 1100;
  inset: 0;
  background: rgba(12, 32, 56, 0.85); /* Navy con opacidad */
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.25s ease;
}

.admin-modal-content {
  position: relative;
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: modalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.admin-modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: color 0.2s ease, border-color 0.2s ease;
  line-height: 1;
}

.admin-modal-close:hover {
  color: var(--red);
  border-color: var(--red);
}

.admin-modal-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 6px;
}

@keyframes modalScaleIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

