:root {
  --bg: #f4f7f9;
  --dark: #121212;
  --card: #ffffff;
  --accent: #e63946;
  --text: #1a1a1a;
  --text-muted: #718096;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

body { 
  margin: 0; 
  font-family: 'Poppins', sans-serif; 
  background-color: var(--bg); 
  color: var(--text); 
}

/* --- LOGIN --- */
.login-screen { 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  height: 100vh; 
  background: var(--bg); 
}
.login-box {
  width: 400px;
  text-align: center;
  background: var(--card);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; 
  flex-direction: column; 
  align-items: center;
}
.login-logo { max-width: 180px; margin-bottom: 20px; height: auto; }
.login-box input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px; 
  margin-bottom: 15px; 
  border-radius: 8px; 
  border: 1px solid #e2e8f0; 
  font-family: inherit;
}
.login-box button {
  width: 100%;
  padding: 12px; 
  border-radius: 8px; 
  border: none; 
  background: var(--dark); 
  color: white; 
  font-weight: 600; 
  cursor: pointer; 
  transition: 0.2s;
}
.login-box button:hover { opacity: 0.9; }
.error { color: red; font-size: 13px; margin-top: 10px; }

/* --- HEADER --- */
.header { 
  background: var(--dark); 
  color: white; 
  padding: 25px 5%; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  border-radius: 0 0 25px 25px; 
}
.event-details h1 { margin: 0; font-size: 18px; font-weight: 600; }
.event-details p { margin: 3px 0 0; opacity: 0.6; font-size: 13px; }
.header-right { display: flex; align-items: center; gap: 20px; }
.header-logo { height: 35px; width: auto; }
.logout { 
  background: rgba(255,255,255,0.1); 
  border: none; 
  color: white; 
  padding: 8px 15px; 
  border-radius: 10px; 
  cursor: pointer; 
  font-size: 13px; 
}

/* --- LAYOUT --- */
.layout { 
  display: grid; 
  grid-template-columns: 1fr 300px; 
  gap: 30px; 
  max-width: 1300px; 
  margin: 30px auto 40px; 
  padding: 0 20px; 
}

/* --- CARDS DE RESUMEN --- */
.resumen { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
  gap: 15px; 
  margin-bottom: 30px; 
}
.card { 
  background: var(--card); 
  padding: 20px; 
  border-radius: var(--radius); 
  box-shadow: var(--shadow); 
  position: relative; 
  text-align: center; 
}
.card-icon { 
  position: absolute; 
  top: 15px; 
  right: 15px; 
  font-size: 14px; /* Icono más pequeño y elegante */
  color: var(--accent); 
  background: #fff5f5; 
  width: 32px; /* Contenedor más discreto */
  height: 32px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  border-radius: 8px; 
}
.card h3 { font-size: 11px; color: var(--text-muted); text-transform: uppercase; margin: 0 0 8px; }
.card .big { font-size: 24px; font-weight: 800; margin: 0; line-height: 1.1; }
.card .subtext { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* --- ETIQUETAS DE DEDUCCIONES (IVA/COMISIÓN) --- */
.tags-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.tag-deduccion {
  background: #f1f5f9;
  color: #475569;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #e2e8f0;
  display: inline-block;
}

/* --- TABLAS Y BUSCADOR --- */
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.search-container { position: relative; width: 280px; }
.search-icon { 
  position: absolute; 
  left: 12px; 
  top: 50%; 
  transform: translateY(-50%); 
  color: var(--text-muted); 
  font-size: 13px; 
}
.search-container input { 
  padding: 8px 10px 8px 35px; 
  margin: 0; 
  border-radius: 10px; 
  font-size: 13px; 
  width: 100%; 
  box-sizing: border-box; 
  border: 1px solid #e2e8f0;
}

table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
th { text-align: left; padding: 0 15px; color: var(--text-muted); font-size: 12px; }
td { background: white; padding: 15px; font-size: 13px; }
td:first-child { border-radius: 10px 0 0 10px; }
td:last-child { border-radius: 0 10px 10px 0; }

.badge { padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.badge-pagado { background: #e6fffa; color: #00a389; }
.badge-pendiente { background: #fffaf0; color: #dd6b20; }

/* --- SIDEBAR --- */
.sidebar-card { background: white; padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); }
.doc-item { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  padding: 12px 0; 
  border-bottom: 1px solid #f1f5f9; 
  cursor: pointer; 
  font-size: 14px; 
}
.doc-icon { color: var(--accent); }
.whatsapp-btn { 
  width: 100%; 
  background: #25d366; 
  color: white; 
  border: none; 
  padding: 12px; 
  border-radius: 10px; 
  font-weight: 600; 
  cursor: pointer; 
  margin-top: 15px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px; 
  font-size: 14px;
}

.legal { text-align: center; padding: 30px; font-size: 11px; color: var(--text-muted); }

/* --- DISEÑO ADAPTABLE (RESPONSIVE) --- */
@media (max-width: 992px) {
  .layout { grid-template-columns: 1fr; margin-top: 20px; }
  .resumen { grid-template-columns: repeat(2, 1fr); }
  .sidebar { order: -1; }
}

@media (max-width: 600px) {
  .resumen { grid-template-columns: 1fr; }
  .header { flex-direction: column; text-align: center; gap: 15px; }
  .table-section { overflow-x: auto; }
  table { min-width: 500px; }
}